diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2010-08-15 18:36:25 -0300 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2010-08-15 18:36:25 -0300 |
commit | 9fda18663f31e67d8c1c50e1c5a1888abceda2a6 (patch) | |
tree | a680bd9c701eaec1016d6beb28bf2c79cfc538e0 /modules/devices/storage.c | |
parent | 9fe6a457e1d9d01f6645d91805691afd429d0a2c (diff) |
Fix potential problems found by clang static analyzer.
Diffstat (limited to 'modules/devices/storage.c')
-rw-r--r-- | modules/devices/storage.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/devices/storage.c b/modules/devices/storage.c index 23ab1de2..a9dfd665 100644 --- a/modules/devices/storage.c +++ b/modules/devices/storage.c @@ -36,10 +36,10 @@ __scan_scsi_devices(void) FILE *proc_scsi; gchar buffer[256], *buf; gint n = 0; - gint scsi_controller; - gint scsi_channel; - gint scsi_id; - gint scsi_lun; + gint scsi_controller = 0; + gint scsi_channel = 0; + gint scsi_id = 0 ; + gint scsi_lun = 0; gchar *vendor = NULL, *revision = NULL, *model = NULL; gchar *scsi_storage_list; @@ -96,7 +96,7 @@ __scan_scsi_devices(void) }; int i; - if (strstr(model, "Flash Disk")) { + if (model && strstr(model, "Flash Disk")) { type = "Flash Disk"; icon = "usbfldisk"; } else { @@ -146,6 +146,8 @@ __scan_scsi_devices(void) g_free(model); g_free(revision); g_free(vendor); + + scsi_controller = scsi_channel = scsi_id = scsi_lun = 0; } } fclose(proc_scsi); |