From d7e7abb0619a03d63aa41e7fc385345258481cf3 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 2 Mar 2013 01:21:13 +0100 Subject: [PATCH] Fix mem leak in config file parser (opendir) This fixes the following leaks: ==30517== 32,808 bytes in 1 blocks are definitely lost in loss record 11 of 12 ==30517== at 0x4C28BED: malloc (vg_replace_malloc.c:263) ==30517== by 0x50F4B2A: __alloc_dir (opendir.c:186) ==30517== by 0x4E34998: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0) ==30517== by 0x4E36350: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0) ==30517== by 0x4E34D98: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0) --- libnfc/conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libnfc/conf.c b/libnfc/conf.c index ca5f801..4e19911 100644 --- a/libnfc/conf.c +++ b/libnfc/conf.c @@ -183,6 +183,7 @@ conf_devices_load(const char *dirname, nfc_context *context) } } } + closedir(d); } void