elput: Fix resource leak
authorChris Michael <cp.michael@samsung.com>
Wed, 25 Jan 2017 14:01:12 +0000 (09:01 -0500)
committerChris Michael <cp.michael@samsung.com>
Wed, 25 Jan 2017 14:09:38 +0000 (09:09 -0500)
Coverity reports that we leak 'msg' here if we fail to append
arguments to the message.

Fixes CID1367499

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/elput/elput_logind.c

index cf5c631..2503448 100644 (file)
@@ -600,7 +600,10 @@ _logind_vt_set(Elput_Manager *em, int vt)
    if (!msg) return EINA_FALSE;
 
    if (!eldbus_message_arguments_append(msg, "u", vt))
-     return EINA_FALSE;
+     {
+        eldbus_message_unref(msg);
+        return EINA_FALSE;
+     }
 
    eldbus_connection_send(em->dbus.conn, msg, NULL, NULL, -1);