projects
/
profile
/
ivi
/
murphy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a38b08
)
amb: fix handling of error cases.
author
Ismo Puustinen
<ismo.puustinen@intel.com>
Tue, 4 Dec 2012 12:35:54 +0000
(14:35 +0200)
committer
Krisztian Litkey
<krisztian.litkey@intel.com>
Thu, 8 Jan 2015 16:37:08 +0000
(18:37 +0200)
src/plugins/plugin-amb.c
patch
|
blob
|
history
diff --git
a/src/plugins/plugin-amb.c
b/src/plugins/plugin-amb.c
index
0691042
..
a350de0
100644
(file)
--- a/
src/plugins/plugin-amb.c
+++ b/
src/plugins/plugin-amb.c
@@
-204,7
+204,7
@@
static int amb_constructor(lua_State *L)
size_t field_name_len;
const char *field_name;
data_t *ctx = global_ctx;
size_t field_name_len;
const char *field_name;
data_t *ctx = global_ctx;
- dbus_property_watch_t *w;
+ dbus_property_watch_t *w
= NULL
;
MRP_LUA_ENTER;
MRP_LUA_ENTER;
@@
-300,11
+300,17
@@
static int amb_constructor(lua_State *L)
w = mrp_allocz(sizeof(dbus_property_watch_t));
w = mrp_allocz(sizeof(dbus_property_watch_t));
+ if (!w)
+ goto error;
+
w->ctx = ctx;
w->lua_prop = prop;
w->prop.initialized = FALSE;
w->ctx = ctx;
w->lua_prop = prop;
w->prop.initialized = FALSE;
- w->prop.name = mrp_strdup(w->lua_prop->dbus_data.name);
w->prop.type = DBUS_TYPE_INVALID;
w->prop.type = DBUS_TYPE_INVALID;
+ w->prop.name = mrp_strdup(w->lua_prop->dbus_data.name);
+
+ if (!w->prop.name)
+ goto error;
if (prop->handler_ref == LUA_NOREF) {
basic_table_data_t *tdata;
if (prop->handler_ref == LUA_NOREF) {
basic_table_data_t *tdata;