summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-24 15:56:56 +0200
committerJim Meyering <meyering@redhat.com>2011-05-25 16:47:33 +0200
commit5853a727de5cd84da483f90cf6f4191549265dae (patch)
treeb89b0933a69608a653a9ad38e28f288f6aae21af
parent0649fbf212224f757245263e5f3c90e423b21571 (diff)
downloadpatch-5853a727de5cd84da483f90cf6f4191549265dae.tar.gz
plug a leak in inp.c's plan_a
* src/inp.c (plan_a): Don't leak "buffer" upon early return.
-rw-r--r--src/inp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/inp.c b/src/inp.c
index e5299c9..47705eb 100644
--- a/src/inp.c
+++ b/src/inp.c
@@ -267,7 +267,10 @@ plan_a (char const *filename)
size = n;
}
else
- return false;
+ {
+ free (buffer);
+ return false;
+ }
}
/* Scan the buffer and build array of pointers to lines. */