projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62370c5
)
nokia-gpio: Fix memory leak
author
Bertrand Aygon
<bertrand.aygon@intel.com>
Wed, 11 May 2011 15:27:43 +0000
(17:27 +0200)
committer
Denis Kenzior
<denkenz@gmail.com>
Wed, 11 May 2011 18:29:33 +0000
(13:29 -0500)
All dir opened with opendir must be closed with closedir
plugins/nokia-gpio.c
patch
|
blob
|
history
diff --git
a/plugins/nokia-gpio.c
b/plugins/nokia-gpio.c
index
b025f3e
..
57aad8d
100644
(file)
--- a/
plugins/nokia-gpio.c
+++ b/
plugins/nokia-gpio.c
@@
-662,8
+662,10
@@
static int gpio_probe_links(void)
FILE *nf;
size_t len;
- if (d == NULL)
+ if (d == NULL) {
+ (void) closedir(gpio);
return 0;
+ }
snprintf(nn, sizeof nn, "%s/%s/name", gpiodir, d->d_name);
@@
-700,6
+702,8
@@
static int gpio_probe_links(void)
DBG("%s: %s", "/sys/class/gpio", strerror(errno));
+ (void) closedir(gpio);
+
return -(errno = ENODEV);
}