fence-virtd: Cleanup small memory leak
Clean up a small memory leak in the TCP plugin on an error path. Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
This commit is contained in:
parent
2c909b78d8
commit
853937d1bd
16
server/tcp.c
16
server/tcp.c
@ -455,11 +455,17 @@ tcp_init(listener_context_t *c, const fence_callbacks_t *cb,
|
||||
info->map = map;
|
||||
|
||||
ret = tcp_config(config, &info->args);
|
||||
if (ret < 0) {
|
||||
if (ret < 0)
|
||||
perror("tcp_config");
|
||||
return -1;
|
||||
} else if (ret > 0) {
|
||||
else if (ret > 0)
|
||||
printf("%d errors found during configuration\n",ret);
|
||||
|
||||
if (ret != 0) {
|
||||
if (info->args.key_file)
|
||||
free(info->args.key_file);
|
||||
if (info->args.addr)
|
||||
free(info->args.addr);
|
||||
free(info);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -483,6 +489,10 @@ tcp_init(listener_context_t *c, const fence_callbacks_t *cb,
|
||||
|
||||
if (listen_sock < 0) {
|
||||
printf("Could not set up listen socket\n");
|
||||
if (info->args.key_file)
|
||||
free(info->args.key_file);
|
||||
if (info->args.addr)
|
||||
free(info->args.addr);
|
||||
free(info);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user