Skip to content

Commit

Permalink
coverity: fix resource leak (uri not free()'ed) in network.c
Browse files Browse the repository at this point in the history
the buffer 'uri' was malloced, and only free'd on the error case.
free it in the normal case.

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed May 22, 2020
1 parent f0dcbf0 commit 605baa9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions network.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ struct iio_context * network_create_context(const char *host)
ctx->description = description;
}

free(uri);
iiod_client_set_timeout(pdata->iiod_client, &pdata->io_ctx,
calculate_remote_timeout(DEFAULT_TIMEOUT_MS));
return ctx;
Expand Down

0 comments on commit 605baa9

Please sign in to comment.