Code Review
/
apps
/
mediaplayer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
bf1b11a
)
binding: media: fix memory leak with json objects
87/10687/1
author
Matt Ranostay
<matt.ranostay@konsulko.com>
Thu, 24 Aug 2017 20:18:52 +0000
(13:18 -0700)
committer
Matt Ranostay
<matt.ranostay@konsulko.com>
Thu, 24 Aug 2017 20:33:05 +0000
(13:33 -0700)
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>
binding/mediaplayer-api.c
patch
|
blob
|
history
diff --git
a/binding/mediaplayer-api.c
b/binding/mediaplayer-api.c
index
e81c98a
..
813ab97
100644
(file)
--- a/
binding/mediaplayer-api.c
+++ b/
binding/mediaplayer-api.c
@@
-86,8
+86,11
@@
static json_object *new_json_object_from_device(GList *list)
json_object_array_add(jarray, jstring);
}
- if (jstring == NULL)
+ if (jstring == NULL) {
+ json_object_put(jarray);
+ json_object_put(jresp);
return NULL;
+ }
json_object_object_add(jresp, "Media", jarray);