Skip to content

Commit

Permalink
fix memory leak when assembling monitoring signals
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Engel <[email protected]>
  • Loading branch information
engelmi committed Dec 8, 2023
1 parent 369bf12 commit 92d1fc9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/manager/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ int monitor_on_unit_property_changed(
monitor->object_path,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}

MonitorPeer *peer = NULL;
Expand All @@ -570,6 +572,8 @@ int monitor_on_unit_property_changed(
peer->name,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}
}

Expand All @@ -591,6 +595,8 @@ int monitor_on_unit_new(void *userdata, const char *node, const char *unit, cons
monitor->object_path,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}

MonitorPeer *peer = NULL;
Expand All @@ -605,6 +611,8 @@ int monitor_on_unit_new(void *userdata, const char *node, const char *unit, cons
peer->name,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}
}

Expand Down Expand Up @@ -632,6 +640,8 @@ int monitor_on_unit_state_changed(
monitor->object_path,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}

MonitorPeer *peer = NULL;
Expand All @@ -646,6 +656,8 @@ int monitor_on_unit_state_changed(
peer->name,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}
}

Expand All @@ -667,6 +679,8 @@ int monitor_on_unit_removed(void *userdata, const char *node, const char *unit,
monitor->object_path,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}

MonitorPeer *peer = NULL;
Expand All @@ -681,6 +695,8 @@ int monitor_on_unit_removed(void *userdata, const char *node, const char *unit,
peer->name,
strerror(-r));
}
sd_bus_message_unrefp(&sig);
sig = NULL;
}
}

Expand Down

0 comments on commit 92d1fc9

Please sign in to comment.