In case of empty media insertion the allocated json_object's
weren't used. Run json_object_put to force the freeing of the
objects.
Bug-AGL: SPEC-842
Change-Id: I48fe8cf0824030119140fa581223c282855981d7
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
json_object_array_add(jarray, jstring);
}
json_object_array_add(jarray, jstring);
}
+ if (jstring == NULL) {
+ json_object_put(jarray);
+ json_object_put(jresp);
json_object_object_add(jresp, "Media", jarray);
json_object_object_add(jresp, "Media", jarray);