]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 25 Oct 2011 16:01:57 +0000 (18:01 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 25 Oct 2011 16:01:57 +0000 (18:01 +0200)
ChangeLog
grub-core/kern/disk.c

index 1b1975215e57af3a9f15515d3b02a6adddadf7e7..7eef0f796d0ec24cbea3f1d78aaedf1c354b5e3a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-25  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak.
+
 2011-10-25  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/romfs.c (grub_romfs_open): Add missing return.
index f296b9d0faabb30a00bf62467be86f573f54ff12..460d8778f39916d90a74287c83c34bc89ef7f233 100644 (file)
@@ -442,6 +442,7 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
        }
     }
 
+  grub_free (tmp_buf);
   grub_errno = GRUB_ERR_NONE;
 
   {
@@ -468,9 +469,11 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
        grub_error_push ();
        grub_dprintf ("disk", "%s read failed\n", disk->name);
        grub_error_pop ();
+       grub_free (tmp_buf);
        return grub_errno;
       }
     grub_memcpy (buf, tmp_buf + offset, size);
+    grub_free (tmp_buf);
     return GRUB_ERR_NONE;
   }
 }