Skip to content

Commit 605baa9

Browse files
committed
coverity: fix resource leak (uri not free()'ed) in network.c
the buffer 'uri' was malloced, and only free'd on the error case. free it in the normal case. Signed-off-by: Robin Getz <robin.getz@analog.com>
1 parent f0dcbf0 commit 605baa9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ struct iio_context * network_create_context(const char *host)
15021502
ctx->description = description;
15031503
}
15041504

1505+
free(uri);
15051506
iiod_client_set_timeout(pdata->iiod_client, &pdata->io_ctx,
15061507
calculate_remote_timeout(DEFAULT_TIMEOUT_MS));
15071508
return ctx;

0 commit comments

Comments
 (0)