projects
/
platform
/
core
/
connectivity
/
bluetooth-frwk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e791089
)
Check NULL condition
93/216393/2
author
Sudipto
<sudipto.bal@samsung.com>
Thu, 24 Oct 2019 09:28:25 +0000
(14:58 +0530)
committer
Sudipto
<sudipto.bal@samsung.com>
Mon, 4 Nov 2019 06:46:48 +0000
(12:16 +0530)
Free memory of a previously declared variable if
g_array_new returns NULL
Change-Id: I373ef9d1641262ef4fd5f18170b6171efbbc72fb
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
bt-api/bt-event-handler.c
patch
|
blob
|
history
diff --git
a/bt-api/bt-event-handler.c
b/bt-api/bt-event-handler.c
index
b2360fa
..
c0df927
100644
(file)
--- a/
bt-api/bt-event-handler.c
+++ b/
bt-api/bt-event-handler.c
@@
-457,6
+457,12
@@
void __bt_adapter_event_filter(GDBusConnection *connection,
}
dbus_data = g_array_new(TRUE, TRUE, sizeof(gchar));
+
+ if (dbus_data == NULL) {
+ BT_ERR("g_array_new failed");
+ g_variant_unref(param);
+ return;
+ }
__bt_fill_garray_from_variant(param, dbus_data);
g_variant_unref(param);