提交 3e3e302f 编写于 作者: M Marc-André Lureau

qga: free remaining leaking state

Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 2aa67a91
...@@ -71,3 +71,9 @@ GACommandState *ga_command_state_new(void) ...@@ -71,3 +71,9 @@ GACommandState *ga_command_state_new(void)
cs->groups = NULL; cs->groups = NULL;
return cs; return cs;
} }
void ga_command_state_free(GACommandState *cs)
{
g_slist_free_full(cs->groups, g_free);
g_free(cs);
}
...@@ -28,6 +28,7 @@ void ga_command_state_add(GACommandState *cs, ...@@ -28,6 +28,7 @@ void ga_command_state_add(GACommandState *cs,
void ga_command_state_init_all(GACommandState *cs); void ga_command_state_init_all(GACommandState *cs);
void ga_command_state_cleanup_all(GACommandState *cs); void ga_command_state_cleanup_all(GACommandState *cs);
GACommandState *ga_command_state_new(void); GACommandState *ga_command_state_new(void);
void ga_command_state_free(GACommandState *cs);
bool ga_logging_enabled(GAState *s); bool ga_logging_enabled(GAState *s);
void ga_disable_logging(GAState *s); void ga_disable_logging(GAState *s);
void ga_enable_logging(GAState *s); void ga_enable_logging(GAState *s);
......
...@@ -1371,6 +1371,8 @@ int main(int argc, char **argv) ...@@ -1371,6 +1371,8 @@ int main(int argc, char **argv)
end: end:
if (s->command_state) { if (s->command_state) {
ga_command_state_cleanup_all(s->command_state); ga_command_state_cleanup_all(s->command_state);
ga_command_state_free(s->command_state);
json_message_parser_destroy(&s->parser);
} }
if (s->channel) { if (s->channel) {
ga_channel_free(s->channel); ga_channel_free(s->channel);
...@@ -1383,6 +1385,10 @@ end: ...@@ -1383,6 +1385,10 @@ end:
} }
config_free(config); config_free(config);
if (s->main_loop) {
g_main_loop_unref(s->main_loop);
}
g_free(s);
return ret; return ret;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册