diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2015-03-31 18:43:36 +0530 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2015-04-01 12:54:11 +0200 |
commit | 801bdcde6a7a92acfdb26d87a17a33802e166a2d (patch) | |
tree | bd6afe4273fea80959f3c862895cfe48e2e147be /ctdb/tcp | |
parent | cd4442c7ac93e165862c9195a7c345472646aa59 (diff) | |
download | samba-801bdcde6a7a92acfdb26d87a17a33802e166a2d.tar.gz |
ctdb: Coverity fix for CID 1291643
CID 1291643: Resource leak: leaked_handle: Handle
variable lock_fd going out of scope leaks the handle.
Fix: on failure case release handle variable lock_fd
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'ctdb/tcp')
-rw-r--r-- | ctdb/tcp/tcp_connect.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index 6950ac85522..22131f789b1 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -347,7 +347,12 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb) ctdb->address = talloc_memdup(ctdb, &ctdb->nodes[i]->address, sizeof(ctdb_sock_addr)); - CTDB_NO_MEMORY(ctdb, ctdb->address); + if (ctdb->address == NULL) { + ctdb_set_error(ctdb, "Out of memory at %s:%d", + __FILE__, __LINE__); + goto failed; + } + ctdb->name = talloc_asprintf(ctdb, "%s:%u", ctdb_addr_to_str(ctdb->address), ctdb_addr_to_port(ctdb->address)); |