mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-19 14:04:17 +03:00
Fix some memory leaks in dmeventd.
This commit is contained in:
parent
0b65565e6b
commit
727f266227
@ -1,7 +1,7 @@
|
|||||||
Version 1.02.19 -
|
Version 1.02.19 -
|
||||||
====================================
|
====================================
|
||||||
Introduce _add_field() and _is_same_field() to libdm-report.c.
|
Introduce _add_field() and _is_same_field() to libdm-report.c.
|
||||||
Fix some libdevmapper-event memory leaks.
|
Fix some libdevmapper-event and dmeventd memory leaks.
|
||||||
Remove unnecessary memset() return value checks.
|
Remove unnecessary memset() return value checks.
|
||||||
Fix a few leaks in reporting error paths. [1.02.15+]
|
Fix a few leaks in reporting error paths. [1.02.15+]
|
||||||
|
|
||||||
|
@ -245,6 +245,8 @@ static struct thread_status *_alloc_thread_status(struct message_data *data,
|
|||||||
|
|
||||||
static void _free_thread_status(struct thread_status *thread)
|
static void _free_thread_status(struct thread_status *thread)
|
||||||
{
|
{
|
||||||
|
if (thread->current_task)
|
||||||
|
dm_task_destroy(thread->current_task);
|
||||||
dm_free(thread->device.uuid);
|
dm_free(thread->device.uuid);
|
||||||
dm_free(thread->device.name);
|
dm_free(thread->device.name);
|
||||||
dm_free(thread);
|
dm_free(thread);
|
||||||
@ -811,11 +813,6 @@ static int _create_thread(struct thread_status *thread)
|
|||||||
|
|
||||||
static int _terminate_thread(struct thread_status *thread)
|
static int _terminate_thread(struct thread_status *thread)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
if ((ret = pthread_cancel(thread->thread)))
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return pthread_kill(thread->thread, SIGALRM);
|
return pthread_kill(thread->thread, SIGALRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1389,7 +1386,7 @@ static int _do_process_request(struct dm_event_daemon_message *msg)
|
|||||||
message_data.msg = msg;
|
message_data.msg = msg;
|
||||||
if (msg->cmd == DM_EVENT_CMD_HELLO) {
|
if (msg->cmd == DM_EVENT_CMD_HELLO) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
answer = dm_strdup(msg->data);
|
answer = msg->data;
|
||||||
if (answer) {
|
if (answer) {
|
||||||
msg->size = dm_asprintf(&(msg->data), "%s HELLO", answer);
|
msg->size = dm_asprintf(&(msg->data), "%s HELLO", answer);
|
||||||
dm_free(answer);
|
dm_free(answer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user