summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-01-14 08:04:23 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-01-14 08:04:23 +0000
commit4f31a3db2af4870fa4a371efacd25135b7e2de11 (patch)
tree0f6bff59d894b7448f2444a56aeccff4676f3d7f
parent155f1900b4b0cf93d0f6a781bfff572d054f60fb (diff)
fix null deref again, this time with the power of spankies
SVN revision: 56105
-rw-r--r--src/lib/eina_mempool.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/eina_mempool.c b/src/lib/eina_mempool.c
index d71a38d..9d25e8a 100644
--- a/src/lib/eina_mempool.c
+++ b/src/lib/eina_mempool.c
@@ -66,18 +66,18 @@ _new_va(const char *name,
66 va_list args) 66 va_list args)
67{ 67{
68 Eina_Mempool_Backend *be; 68 Eina_Mempool_Backend *be;
69 Eina_Mempool *mp = NULL; 69 Eina_Mempool *mp;
70 70
71 Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE; 71 Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
72 72
73 eina_error_set(0); 73 eina_error_set(0);
74 be = eina_hash_find(_backends, name); 74 be = eina_hash_find(_backends, name);
75 if (!be) 75 if ((!be) || (!be->init))
76 goto on_error; 76 goto on_error;
77 77
78 err = EINA_ERROR_OUT_OF_MEMORY; 78 err = EINA_ERROR_OUT_OF_MEMORY;
79 mp = calloc(1, sizeof(Eina_Mempool)); 79 mp = calloc(1, sizeof(Eina_Mempool));
80 if ((!mp) || (!mp->backend.init)) 80 if (!mp)
81 goto on_error; 81 goto on_error;
82 82
83 /* FIXME why backend is not a pointer? */ 83 /* FIXME why backend is not a pointer? */
@@ -88,7 +88,6 @@ _new_va(const char *name,
88 88
89on_error: 89on_error:
90 eina_error_set(err); 90 eina_error_set(err);
91 if (mp) free(mp);
92 return NULL; 91 return NULL;
93} 92}
94 93