Skip to content
Snippets Groups Projects
Commit ae052bc6 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

knsupdate: set freed pointer variable to NULL

Coverity scan #1019150

Change-Id: I09e97249299856612bec953eb79f33b978d23580
parent b933292b
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,7 @@ static void get_addr_str(const struct sockaddr_storage *ss,
// Free previous string if any.
free(*dst);
*dst = NULL;
// Write formated information string.
int ret = snprintf(buf, sizeof(buf), "%s#%u(%s)", addr, port,
......
......@@ -383,11 +383,11 @@ static int pkt_sendrecv(nsupdate_params_t *params,
int ret;
ret = net_init(params->srcif,
params->server,
get_iptype(params->ip),
get_socktype(params->protocol, KNOT_RRTYPE_SOA),
params->wait,
&net);
params->server,
get_iptype(params->ip),
get_socktype(params->protocol, KNOT_RRTYPE_SOA),
params->wait,
&net);
ret = net_connect(&net);
DBG("%s: send_msg = %d\n", __func__, net.sockfd);
......@@ -396,6 +396,7 @@ static int pkt_sendrecv(nsupdate_params_t *params,
ret = net_send(&net, qwire, qlen);
if (ret != KNOT_EOK) {
net_close(&net);
net_clean(&net);
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment