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.
This commit is contained in:
Jean-Pierre André 2013-02-13 08:54:34 +01:00
parent 0e91e1a9ae
commit 6aa24b3df3

View File

@ -660,7 +660,7 @@ static int ntfs_device_get_geo(struct ntfs_device *dev)
#ifdef ENABLE_HD #ifdef ENABLE_HD
{ {
hd_data_t *hddata; hd_data_t *hddata;
hd_t *devlist, *partlist, *hd; hd_t *hd, *devlist, *partlist = NULL;
str_list_t *names; str_list_t *names;
hd_res_t *res; hd_res_t *res;
const int d_name_len = strlen(dev->d_name) + 1; const int d_name_len = strlen(dev->d_name) + 1;
@ -742,7 +742,8 @@ got_hd:
done = 1; done = 1;
} }
end_hd: end_hd:
hd_free_hd_list(partlist); if (partlist)
hd_free_hd_list(partlist);
hd_free_hd_list(devlist); hd_free_hd_list(devlist);
hd_free_hd_data(hddata); hd_free_hd_data(hddata);
free(hddata); free(hddata);