Version 1.02.19 -
====================================
+ Fix libdevmapper-event memory leaks
Remove unnecessary memset() return value checks.
Fix a few leaks in reporting error paths. [1.02.15+]
*/
if (!_daemon_write(fifos, msg)) {
stack;
+ dm_free(msg->data);
+ msg->data = 0;
return -EIO;
}
do {
+
+ if (msg->data)
+ dm_free(msg->data);
+ msg->data = 0;
+
if (!_daemon_read(fifos, msg)) {
stack;
return -EIO;
}
ret = _daemon_talk(&fifos, msg, DM_EVENT_CMD_HELLO, 0, 0, 0, 0);
+
+ if (msg->data)
+ dm_free(msg->data);
+ msg->data = 0;
+
if (!ret)
ret = _daemon_talk(&fifos, msg, cmd, dso_name, dev_name, evmask, timeout);
dm_event_handler_set_dso(dmevh, reply_dso);
dm_event_handler_set_event_mask(dmevh, reply_mask);
+
+ if (reply_dso)
+ dm_free(reply_dso);
+ if (reply_uuid)
+ dm_free(reply_uuid);
+
dmevh->dev_name = dm_strdup(dm_task_get_name(dmt));
if (!dmevh->dev_name) {
ret = -ENOMEM;
fail:
if (msg.data)
dm_free(msg.data);
+ if (reply_dso)
+ dm_free(reply_dso);
+ if (reply_uuid)
+ dm_free(reply_uuid);
_dm_event_handler_clear_dev_info(dmevh);
dm_task_destroy(dmt);
return ret;