mirror of git://git.sysmocom.de/ofono
smsutil: fix a memory leak
This was reported by cppcheck.
This commit is contained in:
parent
9871da333a
commit
0403b341ca
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue