diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index c735194c4..795776b57 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.111 - ==================================== + Test dm_task_get_message_response for !NULL in dm_stats_print_region(). Add checks for failing dm_stats_create() in dmsetup. Add missing fifo close when failed to initialize client connection. diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 43479d943..505b06227 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -1259,6 +1259,7 @@ char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id, { char *resp = NULL; struct dm_task *dmt = NULL; + const char *response; if (!_stats_bound(dms)) return_0; @@ -1269,7 +1270,10 @@ char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id, if (!dmt) return_0; - resp = dm_pool_strdup(dms->mem, dm_task_get_message_response(dmt)); + if (!(response = dm_task_get_message_response(dmt))) + return_0; + + resp = dm_pool_strdup(dms->mem, response); dm_task_destroy(dmt); if (!resp)