[2724] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[PATCH] Don't leaks memory when .anyone file is missing

daemon@ATHENA.MIT.EDU (David Benjamin)
Sat Oct 23 16:07:35 2010

From: David Benjamin <davidben@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Sat, 23 Oct 2010 16:07:19 -0400

Also caught by valgrind.
---
 zephyr.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/zephyr.c b/zephyr.c
index 790d627..1121caf 100644
--- a/zephyr.c
+++ b/zephyr.c
@@ -379,10 +379,11 @@ int owl_zephyr_loadloginsubs(const char *filename)
 
   subs = owl_malloc(numSubs * sizeof(ZSubscription_t));
   subsfile = owl_zephyr_dotfile(".anyone", filename);
 
   if (stat(subsfile, &statbuff) == -1) {
+    owl_free(subs);
     owl_free(subsfile);
     return 0;
   }
 
   ZResetAuthentication();
-- 
1.7.3.1.g716de


home help back first fref pref prev next nref lref last post