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

utils: fix resource leak and bad free

Coverity CID 1005243 and CID 1005244

Change-Id: I29fbc8d82278951064e984eeb08fdb9189136309
parent 4fa9b36f
No related branches found
No related tags found
No related merge requests found
......@@ -364,16 +364,13 @@ void print_header_xfr(const knot_question_t *question, const style_t *style)
return;
}
char *owner = knot_dname_to_str(question->qname);
if (owner == NULL) {
owner = "NULL";
}
if (style->show_header) {
printf(";; %s for %s\n", xfr, owner);
char *owner = knot_dname_to_str(question->qname);
if (owner != NULL) {
printf("\n;; %s for %s\n", xfr, owner);
free(owner);
}
}
free(owner);
}
void print_data_xfr(const knot_packet_t *packet,
......
......@@ -516,6 +516,8 @@ static int process_xfr_packet(const knot_packet_t *query,
// Compare reply header id.
if (check_reply_id(reply, query) == false) {
knot_packet_free(&reply);
net_close(&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