From 6aa24b3df3fd084739b3c2ccced4be8225cc908d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 13 Feb 2013 08:54:34 +0100 Subject: [PATCH] Fixed a use of uninitialized variable compiler warning Author: Anton Altaparmakov Date: Wed Feb 13 02:29:47 2013 +0000 This is a fix to the use of hd library to get the legacy BIOS geometry. --- libntfs-3g/device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/device.c b/libntfs-3g/device.c index 0e4682d7..a5c32f42 100644 --- a/libntfs-3g/device.c +++ b/libntfs-3g/device.c @@ -660,7 +660,7 @@ static int ntfs_device_get_geo(struct ntfs_device *dev) #ifdef ENABLE_HD { hd_data_t *hddata; - hd_t *devlist, *partlist, *hd; + hd_t *hd, *devlist, *partlist = NULL; str_list_t *names; hd_res_t *res; const int d_name_len = strlen(dev->d_name) + 1; @@ -742,7 +742,8 @@ got_hd: done = 1; } end_hd: - hd_free_hd_list(partlist); + if (partlist) + hd_free_hd_list(partlist); hd_free_hd_list(devlist); hd_free_hd_data(hddata); free(hddata);