summaryrefslogtreecommitdiff
path: root/common/test_textfile.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-07 17:23:00 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-07 17:23:00 +0000
commita8b5fad54044c7b5e7c6aa30ad24e5a86fc51daf (patch)
tree129bfe1b3b4ebf5232087ea12ed315872434c062 /common/test_textfile.c
parent9848c1fa4ee7b49d425cb790fe9ab5edff8761dd (diff)
downloadbluez-a8b5fad54044c7b5e7c6aa30ad24e5a86fc51daf.tar.gz
Fix memory leaks with textfile_get() usage
Diffstat (limited to 'common/test_textfile.c')
-rw-r--r--common/test_textfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/test_textfile.c b/common/test_textfile.c
index 54202d2c2..5a783d20e 100644
--- a/common/test_textfile.c
+++ b/common/test_textfile.c
@@ -34,6 +34,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
#include "textfile.h"
@@ -64,6 +65,8 @@ int main(int argc, char *argv[])
str = textfile_get(filename, key);
if (!str)
fprintf(stderr, "No value for %s\n", key);
+ else
+ free(str);
}
return 0;