From fe8352bf60638f0da55669bd9e55a75ad7e300e4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 22 Feb 2013 17:39:26 +0100 Subject: Keep Valgrind quiet --- src/im-sandbox.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/im-sandbox.c') diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 290f811f..1ba6b2ce 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -127,6 +127,7 @@ static char *get_pattern(FILE *fh, char **use_this_one_instead, { char *line; char *filename; + size_t len; do { @@ -160,7 +161,13 @@ static char *get_pattern(FILE *fh, char **use_this_one_instead, line = tmp; } - filename = malloc(strlen(prefix)+strlen(line)+1); + len = strlen(prefix)+strlen(line)+1; + + /* Round the length of the buffer, too keep Valgrind quiet when it gets + * given to write() a bit later on */ + len += 4 - (len % 4); + + filename = malloc(len); snprintf(filename, 1023, "%s%s", prefix, line); -- cgit v1.2.3