Skip to content

Commit

Permalink
ctdb: check for talloc_asprintf() failure
Browse files Browse the repository at this point in the history
Signed-off-by: David Disseldorp <[email protected]>
Reviewed-by: Michael Adam <[email protected]>

Autobuild-User(master): Michael Adam <[email protected]>
Autobuild-Date(master): Wed Apr  1 15:36:03 CEST 2015 on sn-devel-104
  • Loading branch information
ddiss authored and obnoxxx committed Apr 1, 2015
1 parent 801bdcd commit 12309f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ctdb/tcp/tcp_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
ctdb->name = talloc_asprintf(ctdb, "%s:%u",
ctdb_addr_to_str(ctdb->address),
ctdb_addr_to_port(ctdb->address));
if (ctdb->name == NULL) {
ctdb_set_error(ctdb, "Out of memory at %s:%d",
__FILE__, __LINE__);
goto failed;
}
DEBUG(DEBUG_INFO,("ctdb chose network address %s\n", ctdb->name));

if (listen(ctcp->listen_fd, 10) == -1) {
Expand Down

0 comments on commit 12309f8

Please sign in to comment.