]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
desktop-file test: Free result on all code paths
authorRalf Habacker <ralf.habacker@freenet.de>
Sat, 18 Apr 2020 11:34:19 +0000 (13:34 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 27 Apr 2020 12:39:35 +0000 (12:39 +0000)
Otherwise, Coverity will diagnose this as a resource leak,
because it doesn't understand that our assertions end up guaranteeing
that the result is freed if and only if it's non-`NULL`.

Coverity CID: 354884

test/internals/desktop-file.c

index a11801f0ee7ac2dad606033a4d00cafef6a7aeb6..4db4076fa23853b3523ed6c42b01ac2d0a1ce87b 100644 (file)
@@ -221,8 +221,8 @@ test_content (const Test *test,
           test_assert_no_error (&error);
           g_assert_true (ok);
           g_assert_cmpstr (val, ==, test->value);
-          dbus_free (val);
         }
+      dbus_free (val);
     }
 }