projects
/
platform
/
upstream
/
kbd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9426027
)
analyze.l: Fix potential memory leak
author
Alexey Gladkov
<gladkov.alexey@gmail.com>
Sun, 14 Apr 2013 19:34:13 +0000
(23:34 +0400)
committer
Alexey Gladkov
<gladkov.alexey@gmail.com>
Sun, 14 Apr 2013 19:34:13 +0000
(23:34 +0400)
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
src/libkeymap/analyze.l
patch
|
blob
|
history
diff --git
a/src/libkeymap/analyze.l
b/src/libkeymap/analyze.l
index
92df059
..
7adffbc
100644
(file)
--- a/
src/libkeymap/analyze.l
+++ b/
src/libkeymap/analyze.l
@@
-114,7
+114,7
@@
static int
find_incl_file_near_fn(struct keymap *kmap, char *s, char *fn, lkfile_t *fp)
{
const char *include_dirpath2[] = { 0, 0, 0, 0 };
- char *t, *te, *t1
, *t2
;
+ char *t, *te, *t1
= NULL, *t2 = NULL
;
int len, rc = 1;
if (!fn)
@@
-146,8
+146,10
@@
find_incl_file_near_fn(struct keymap *kmap, char *s, char *fn, lkfile_t *fp)
free(t);
return rc;
- /* FIXME: free */
nomem: ERR(kmap, _("out of memory"));
+ if (t1) free(t1);
+ if (t2) free(t2);
+ if (t) free(t);
return -1;
}