]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code/shec/shec.cc: fix resource leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 24 Feb 2015 09:50:11 +0000 (10:50 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 24 Feb 2015 09:50:11 +0000 (10:50 +0100)
Free tmpmat in error case. Fix for:

[src/erasure-code/shec/shec.cc:176]: (error) Memory leak: tmpmat

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/erasure-code/shec/shec.cc

index 3b375b2b32cd6172e05afa55fb4fff2b115b6c8c..178b7652b036199f92f1d9f0ee8bbb981e9c197b 100644 (file)
@@ -172,6 +172,7 @@ int shec_make_decoding_matrix(bool prepare, int k, int m, int w, int *matrix, in
   }
 
   if (ek > m){
+    free(tmpmat);
     return -1;
   }