clone the object instead of serializing and then parsing
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 17 Dec 2008 20:25:17 +0000 (20:25 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 17 Dec 2008 20:25:17 +0000 (20:25 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11607 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c

index 40aee2d..7bf6688 100644 (file)
@@ -1459,6 +1459,7 @@ static jsonObject* doRetrieve(osrfMethodContext* ctx, int* err ) {
                osrfHashGet(meta, "fieldmapper"),
                id
        );
+       free(id);
 
        jsonObject* fake_params = jsonNewObjectType(JSON_ARRAY);
        jsonObjectPush(fake_params, jsonNewObjectType(JSON_HASH));
@@ -1466,10 +1467,9 @@ static jsonObject* doRetrieve(osrfMethodContext* ctx, int* err ) {
        jsonObjectSetKey(
                jsonObjectGetIndex(fake_params, 0),
                osrfHashGet(meta, "primarykey"),
-               jsonParseString(id)
+               jsonObjectClone(jsonObjectGetIndex(ctx->params, id_pos))
        );
 
-       free(id);
 
        if (order_hash) jsonObjectPush(fake_params, jsonObjectClone(order_hash) );