From 81575387ccc393d75983cb70c5a923472130d78a Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 22 May 2020 11:47:31 -0400 Subject: [PATCH] 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 --- network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network.c b/network.c index c4a5bce36..3496aa198 100644 --- a/network.c +++ b/network.c @@ -1461,6 +1461,7 @@ struct iio_context * network_create_context(const char *host) ret = iio_context_add_attr(ctx, "uri", uri); if (ret < 0) goto err_free_description; + free(uri); for (i = 0; i < ctx->nb_devices; i++) { struct iio_device *dev = ctx->devices[i];