summaryrefslogtreecommitdiffstats
path: root/common/mem.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2011-12-12 17:53:04 +0000
committerAlon Levy <alevy@redhat.com>2012-01-13 18:11:58 +0200
commitfaf0947ebbcdbd2088d6349e936a23b24d09153b (patch)
treebd3376100183cb58cbf9351a12efd7e47a7e423a /common/mem.c
parent64f4826b6d6918b81d336f8c4296dc6094067f64 (diff)
downloadspice-faf0947ebbcdbd2088d6349e936a23b24d09153b.tar.gz
spice-faf0947ebbcdbd2088d6349e936a23b24d09153b.tar.xz
spice-faf0947ebbcdbd2088d6349e936a23b24d09153b.zip
Remove useless if() before free()
The free() function allows NULL to be passed in, so any code which puts a if() before free() is wasting time
Diffstat (limited to 'common/mem.c')
-rw-r--r--common/mem.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/common/mem.c b/common/mem.c
index 7236cf0c..5298e37d 100644
--- a/common/mem.c
+++ b/common/mem.c
@@ -130,9 +130,7 @@ void *spice_realloc(void *mem, size_t n_bytes)
(unsigned long)n_bytes);
}
- if (mem) {
- free(mem);
- }
+ free(mem);
return NULL;
}