summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Habkost2014-05-30 22:02:18 +0200
committerMichael Tokarev2014-06-24 18:01:24 +0200
commitfeced894fb6c474eb56daeb2b2d1f99bae87677f (patch)
tree1159d990adc4d170bd5b19554ca179fffc985b06
parentblock.c: Remove useless 'buf' variable (diff)
downloadqemu-feced894fb6c474eb56daeb2b2d1f99bae87677f.tar.gz
qemu-feced894fb6c474eb56daeb2b2d1f99bae87677f.tar.xz
qemu-feced894fb6c474eb56daeb2b2d1f99bae87677f.zip
rng-random: NULL check not needed before g_free()
g_free() is NULL-safe. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--backends/rng-random.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 136499d305..601d9dc0c2 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -106,10 +106,7 @@ static void rng_random_set_filename(Object *obj, const char *filename,
return;
}
- if (s->filename) {
- g_free(s->filename);
- }
-
+ g_free(s->filename);
s->filename = g_strdup(filename);
}