config-ports: added error checking on talloc

This commit is contained in:
Nikos Mavrogiannopoulos
2015-12-03 14:48:33 +01:00
parent a580303e95
commit 2e68ba1158

View File

@@ -36,6 +36,11 @@ static int append_port(void *pool, FwPortSt ***fw_ports, size_t *n_fw_ports, int
return -1;
current = talloc(pool, FwPortSt);
if (current == NULL) {
talloc_free(*fw_ports);
*fw_ports = NULL;
return -1;
}
fw_port_st__init(current);
current->port = port;