From: Ismo Puustinen Date: Mon, 25 Nov 2013 14:28:09 +0000 (+0200) Subject: amb: fixed issues reported by static analysis. X-Git-Tag: accepted/tizen/ivi/20150112.012920~308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b174911f3d188360bea41841ad840c4b4f0da83;p=profile%2Fivi%2Fmurphy.git amb: fixed issues reported by static analysis. Change-Id: Idc4a1802735150b2610ce1ab4db7491b9f4b5dcd --- diff --git a/src/plugins/plugin-amb.c b/src/plugins/plugin-amb.c index 0f73556..a042b97 100644 --- a/src/plugins/plugin-amb.c +++ b/src/plugins/plugin-amb.c @@ -240,7 +240,7 @@ static void destroy_prop(data_t *ctx, dbus_property_watch_t *w) static int amb_constructor(lua_State *L) { lua_amb_property_t *prop; - size_t field_name_len; + size_t field_name_len = 0; const char *field_name; data_t *ctx = global_ctx; dbus_property_watch_t *w = NULL; @@ -253,6 +253,9 @@ static int amb_constructor(lua_State *L) prop = (lua_amb_property_t *) mrp_lua_create_object(L, PROPERTY_CLASS, NULL, 0); + if (!prop) + goto error; + prop->handler_ref = LUA_NOREF; prop->outputs_ref = LUA_NOREF; @@ -1050,7 +1053,7 @@ static void basic_property_updated(dbus_basic_property_t *prop, void *userdata) break; case mqi_integer: buflen = snprintf(buf, 512, "INSERT INTO %s VALUES (1, '%s', %d)", - w->lua_prop->basic_table_name, prop->name, prop->value.i); + w->lua_prop->basic_table_name, prop->name, (int) prop->value.i); break; case mqi_unsignd: buflen = snprintf(buf, 512, "INSERT INTO %s VALUES (1, '%s', %u)",