diff options
author | Pauli Nieminen <ext-pauli.nieminen@nokia.com> | 2010-07-22 11:33:33 +0300 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-09-01 14:42:55 +1000 |
commit | 1223340644744c0b38aa85f5956eb5ab7c696517 (patch) | |
tree | 1d591e89ab8cc2db2cd440826ac5cda129f1ab35 /xkb | |
parent | 20cb9c923efa4edc348eba30f956a66413a8208f (diff) |
xkb: Fix memory leak if opening file fails
If fopen fails pointer in buf would be overwriten with a new pointer.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/ddxList.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c index 2256424d0..39bd7397a 100644 --- a/xkb/ddxList.c +++ b/xkb/ddxList.c @@ -161,6 +161,7 @@ char tmpname[PATH_MAX]; } if (!in) { haveDir= FALSE; + free(buf); buf = Xprintf( "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long) @@ -176,6 +177,7 @@ char tmpname[PATH_MAX]; } if (!in) { haveDir= FALSE; + free(buf); buf = Xprintf( "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, componentDirs[what],(long) |