From b4feb0181876d8ef87a6b5eae3ea5d26c6e526e0 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 10 Dec 2009 23:09:56 +0100 Subject: [PATCH] Fix memory allocation problem in exec.c Bug reported by c0nv1ct. --- src/exec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exec.c b/src/exec.c index be72485e..85e12ab3 100644 --- a/src/exec.c +++ b/src/exec.c @@ -168,11 +168,10 @@ static inline void read_exec(const char *data, char *buf, const int size) static double read_exec_barnum(const char *data) { - static char *buf = NULL; + char *buf = NULL; double barnum; - if (!buf) - buf = malloc(text_buffer_size); + buf = malloc(text_buffer_size); read_exec(data, buf, text_buffer_size); barnum = get_barnum(buf);