diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 43cc9e388..4da95deed 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.71 - ==================================== + Fix memory leak in fail path of parse_loop_device_name() in dmsetup. Check for missing reply_uuid in dm_event_get_registered_device(). Check for allocation failure in dmeventd restart(). Add few missing allocation failures tests in dmsetup. diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 11c7bcd7e..f59d39d23 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -3043,6 +3043,8 @@ static char *_get_abspath(const char *path) _path = canonicalize_file_name(path); #else /* FIXME Provide alternative */ + log_error(INTERNAL_ERROR "Unimplemented _get_abspath."); + _path = NULL; #endif return _path; } @@ -3050,7 +3052,7 @@ static char *_get_abspath(const char *path) static char *parse_loop_device_name(const char *dev, const char *dev_dir) { char *buf; - char *device; + char *device = NULL; if (!(buf = dm_malloc(PATH_MAX))) return NULL; @@ -3083,7 +3085,9 @@ static char *parse_loop_device_name(const char *dev, const char *dev_dir) return buf; error: + dm_free(device); dm_free(buf); + return NULL; }