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>
This commit is contained in:
Stefan Weil 2012-09-01 11:06:45 +02:00 committed by Kevin Wolf
parent 1e53537fda
commit 45724d6d02
1 changed files with 1 additions and 2 deletions

View File

@ -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)