aboutsummaryrefslogtreecommitdiff
path: root/block/curl.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-09-01 11:06:45 +0200
committerKevin Wolf <kwolf@redhat.com>2012-09-12 15:50:09 +0200
commit45724d6d02383b0d7d4a90e05787fca7c55cb070 (patch)
treeda5b37d1e41a11b8aac0569c3319400f5bee9019 /block/curl.c
parent1e53537fdaa4657d11f130a0f2673fcfb1956381 (diff)
block/curl: Fix wrong free statement
Report from smatch: block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free() The check was redundant, and free was also wrong because the memory was allocated using g_strdup. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/curl.c')
-rw-r--r--block/curl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/curl.c b/block/curl.c
index e7c3634d35..c1074cd2e3 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -542,8 +542,7 @@ static void curl_close(BlockDriverState *bs)
}
if (s->multi)
curl_multi_cleanup(s->multi);
- if (s->url)
- free(s->url);
+ g_free(s->url);
}
static int64_t curl_getlength(BlockDriverState *bs)