summaryrefslogtreecommitdiff
path: root/hw/xfree86/parser/Pointer.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-10 07:58:27 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-10 07:58:27 +0000
commit55f677d600370b19d62ef821025481f2be6f5edb (patch)
tree1e354e55f52cf8910867a3ba4dd4fd8dc900de6e /hw/xfree86/parser/Pointer.c
parent2bd41105496b729395fbcf97f09581eb0efb3510 (diff)
Coverity #813, #814, #815, #816: Fix resource leaks in error paths of
config parsing code.
Diffstat (limited to 'hw/xfree86/parser/Pointer.c')
-rw-r--r--hw/xfree86/parser/Pointer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c
index 81984a3e7..c17aa5846 100644
--- a/hw/xfree86/parser/Pointer.c
+++ b/hw/xfree86/parser/Pointer.c
@@ -186,8 +186,10 @@ xf86parsePointerSection (void)
if (val.num < 0)
Error (ZAXISMAPPING_MSG, NULL);
s1 = xf86uLongToString(val.num);
- if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) {
+ xf86conffree(s1);
Error (ZAXISMAPPING_MSG, NULL);
+ }
s2 = xf86uLongToString(val.num);
l = strlen(s1) + 1 + strlen(s2) + 1;
s = xf86confmalloc(l);