mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-12-05 22:08:19 +00:00
Previous leak fix caused multiple sensors_init() calls to break.
This patch fixes that by managing the scanner buffers manually. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3300 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
54423af70d
commit
4d2c4fd212
3 files changed
+58
-4
No files matched your search
+5
-1
@@ -26,6 +26,7 @@
|
||||
#include "access.h"
|
||||
#include "conf.h"
|
||||
#include "sysfs.h"
|
||||
#include "scanner.h"
|
||||
|
||||
static void free_proc_chips_entry(sensors_proc_chips_entry entry);
|
||||
static void free_chip_name(sensors_chip_name name);
|
||||
@@ -48,7 +49,8 @@ int sensors_init(FILE *input)
|
||||
if ((res = sensors_read_proc_chips()) || (res = sensors_read_proc_bus()))
|
||||
return res;
|
||||
}
|
||||
sensors_yyin = input;
|
||||
if ((res = sensors_scanner_init(input)))
|
||||
return -SENSORS_ERR_PARSE;
|
||||
if ((res = sensors_yyparse()))
|
||||
return -SENSORS_ERR_PARSE;
|
||||
if ((res = sensors_substitute_busses()));
|
||||
@@ -60,6 +62,8 @@ void sensors_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
sensors_scanner_exit();
|
||||
|
||||
for (i = 0; i < sensors_proc_chips_count; i++)
|
||||
free_proc_chips_entry(sensors_proc_chips[i]);
|
||||
free(sensors_proc_chips);
|
||||
|
||||
Reference in new issue
Block a user