]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
unix/relpath: memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 19 Jun 2015 15:38:25 +0000 (18:38 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 19 Jun 2015 15:38:25 +0000 (18:38 +0300)
Found by Coverity scan.
CID: 96606

grub-core/osdep/unix/relpath.c

index 8fdc3a73a6d79f3167eab250864f254be056c2cb..f719950fd8638bf29a537b172b173c4cbfd171a0 100644 (file)
@@ -51,7 +51,10 @@ grub_make_system_path_relative_to_its_root (const char *path)
 #ifdef __linux__
   ret = grub_make_system_path_relative_to_its_root_os (p);
   if (ret)
-    return ret;
+    {
+      free (p);
+      return ret;
+    }
 #endif
 
   /* For ZFS sub-pool filesystems.  */