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

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

index d66d5e3..9d03b0c 100644 (file)
@@ -925,6 +925,7 @@ jsonObject* doRetrieve(osrfMethodContext* ctx, int* err ) {
                osrfHashGet(meta, "fieldmapper"),
                id
        );
+       free(id);
 
        jsonObject* fake_params = jsonParseString("[]");
        jsonObjectPush(fake_params, jsonParseString("{}"));
@@ -932,7 +933,7 @@ jsonObject* doRetrieve(osrfMethodContext* ctx, int* err ) {
        jsonObjectSetKey(
                jsonObjectGetIndex(fake_params, 0),
                osrfHashGet(meta, "primarykey"),
-               jsonParseString(id)
+               jsonObjectClone(jsonObjectGetIndex(ctx->params, 0))
        );
 
        if (order_hash) jsonObjectPush(fake_params, jsonObjectClone(order_hash) );