summaryrefslogtreecommitdiffstats
path: root/src/smsutil.c
diff options
context:
space:
mode:
authorBertrand Aygon <bertrand.aygon@intel.com>2011-03-18 14:18:02 +0100
committerDenis Kenzior <denkenz@gmail.com>2011-03-18 11:29:06 -0500
commit0403b341cad7076a7c2552d361f6dd6c6d75faf1 (patch)
tree69e48dff4077a709fe60a45abec4766e02f38b80 /src/smsutil.c
parent9871da333a7a3d102b59d3ba455b5ac80811f985 (diff)
downloadofono-0403b341cad7076a7c2552d361f6dd6c6d75faf1.tar.bz2
smsutil: fix a memory leak
This was reported by cppcheck.
Diffstat (limited to 'src/smsutil.c')
-rw-r--r--src/smsutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/smsutil.c b/src/smsutil.c
index 5524932f..e7813994 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -3344,7 +3344,7 @@ void sms_tx_backup_free(const char *imsi, unsigned long id,
len = scandir(path, &entries, NULL, versionsort);
if (len < 0)
- return;
+ goto nodir_exit;
/* skip '..' and '.' entries */
while (len-- > 2) {
@@ -3362,6 +3362,8 @@ void sms_tx_backup_free(const char *imsi, unsigned long id,
g_free(entries);
rmdir(path);
+
+nodir_exit:
g_free(path);
}