g_free() is NULL-safe.

Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
---
Cc: Anthony Liguori <aligu...@amazon.com>
Cc: Luiz Capitulino <lcapitul...@redhat.com>
---
 backends/rng-random.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 136499d..601d9dc 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);
 }
 
-- 
1.9.0


Reply via email to