Skip to content

Commit

Permalink
fix(query): memory leak on allocation error
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryAlien committed Jan 30, 2023
1 parent ae4e205 commit 7bfb222
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static SSQ_PACKET **ssq_query_recv(SOCKET sockfd, uint8_t *packet_count, SSQ_ERR
*packet_count = packet->total;
packets = calloc(*packet_count, sizeof (*packets));
if (packets == NULL) {
ssq_packet_free(packet);
ssq_error_set_from_errno(err);
break;
}
Expand Down

0 comments on commit 7bfb222

Please sign in to comment.