Skip to content
Snippets Groups Projects
Commit 083b7ef6 authored by bobcanthelpyou's avatar bobcanthelpyou Committed by Christof Schulze
Browse files

gluon-mesh-babel: 'buf' nulled but not freed upon failure

parent bcf4d076
No related branches found
No related tags found
No related merge requests found
......@@ -543,11 +543,12 @@ static int ask_l3roamd_for_client_count() {
int rc = 0;
do {
buf = realloc(buf, already_read + SOCKET_INPUT_BUFFER_SIZE + 1);
if (buf == NULL) {
char *buf_tmp = realloc(buf, already_read + SOCKET_INPUT_BUFFER_SIZE + 1);
if (buf_tmp == NULL) {
fprintf(stderr, "could not allocate memory for buffer\n");
goto end;
}
buf = buf_tmp;
rc = read(fd, &buf[already_read], SOCKET_INPUT_BUFFER_SIZE);
already_read+=rc;
......
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