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

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

index ae10adb..bfab8b8 100644 (file)
@@ -998,6 +998,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));
@@ -1005,10 +1006,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) );