diff options
author | Roman Kalashnikov <lunix0x@gmail.com> | 2017-10-30 00:56:32 +0300 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-10-29 14:56:32 -0700 |
commit | 9114299df972f43bef08e64da81fe39896334a81 (patch) | |
tree | cc6de216052ad4838019a26847e6263c7034604f /modules | |
parent | 91d5f25b4515e2af7cf5ad1c05db8ad2e57b46ed (diff) |
Fixed possible memory leak (#201)
Warnings, found using PVS-Studio:
hardinfo/modules/devices/usb.c 397 err V773 The function was exited without releasing the 'temp' pointer. A memory leak is possible.
hardinfo/modules/computer/uptime.c 33 err V773 The function was exited without releasing the 'ui' pointer. A memory leak is possible.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/computer/uptime.c | 1 | ||||
-rw-r--r-- | modules/devices/usb.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/modules/computer/uptime.c b/modules/computer/uptime.c index 5f0f1942..6ef3d250 100644 --- a/modules/computer/uptime.c +++ b/modules/computer/uptime.c @@ -30,6 +30,7 @@ computer_get_uptime(void) ui->minutes = minutes / 60; fclose(procuptime); } else { + g_free(ui); return NULL; } diff --git a/modules/devices/usb.c b/modules/devices/usb.c index e5088bd2..9366c7ce 100644 --- a/modules/devices/usb.c +++ b/modules/devices/usb.c @@ -394,6 +394,7 @@ gboolean __scan_usb_lsusb(void) if (!temp_lsusb) { DEBUG("cannot create temporary file for lsusb"); pclose(lsusb); + g_free(temp); return FALSE; } |