]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
boot-splash: fix memory leak in error path
authorRay Strode <rstrode@redhat.com>
Tue, 16 Oct 2018 01:04:47 +0000 (21:04 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 16 Oct 2018 01:04:47 +0000 (21:04 -0400)
If the splash key file fails to load, we don't free
the associated key file object.

This commit fixes that.

src/libply-splash-core/ply-boot-splash.c

index 2e295f42039c3ddd6a33e50eed81d061370f9c71..54c769650ccb2849f9388f1eb4336c4950a621aa 100644 (file)
@@ -208,8 +208,10 @@ ply_boot_splash_load (ply_boot_splash_t *splash)
 
         key_file = ply_key_file_new (splash->theme_path);
 
-        if (!ply_key_file_load (key_file))
+        if (!ply_key_file_load (key_file)) {
+                ply_key_file_free (key_file);
                 return false;
+        }
 
         module_name = ply_key_file_get_value (key_file, "Plymouth Theme", "ModuleName");