mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-30 13:00:30 +00:00
Fix memory leak in scanner when using flex 2.5.9 or later.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5637 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
09abbcb686
commit
556b03e425
2 files changed
+11
No files matched your search
@@ -8,6 +8,7 @@ SVN-HEAD
|
||||
Detect excessive recursion depth during expression eval (#2365)
|
||||
Return a string rather than NULL for unknown errors
|
||||
Skip non-file sysfs entries for speed
|
||||
Fix memory leak in scanner when using flex 2.5.9 or later
|
||||
lm_sensors.init: Support new format of /etc/sysconfig/lm_sensors (#2246)
|
||||
Drop support for kernels 2.4 and earlier
|
||||
lm_sensors.init.suse: Delete (actual SuSE script is much different)
|
||||
|
||||
@@ -350,5 +350,15 @@ void sensors_scanner_exit(void)
|
||||
{
|
||||
sensors_yy_delete_buffer(scan_buf);
|
||||
scan_buf = (YY_BUFFER_STATE)0;
|
||||
|
||||
/* As of flex 2.5.9, yylex_destroy() must be called when done with the
|
||||
scaller, otherwise we'll leak memory. */
|
||||
#if defined(YY_FLEX_MAJOR_VERSION) && defined(YY_FLEX_MINOR_VERSION) && defined(YY_FLEX_SUBMINOR_VERSION)
|
||||
#if YY_FLEX_MAJOR_VERSION > 2 || \
|
||||
(YY_FLEX_MAJOR_VERSION == 2 && (YY_FLEX_MINOR_VERSION > 5 || \
|
||||
(YY_FLEX_MINOR_VERSION == 5 && YY_FLEX_SUBMINOR_VERSION >= 9)))
|
||||
sensors_yylex_destroy();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user