From: Lennart Poettering Date: Fri, 30 Apr 2010 00:16:22 +0000 (+0200) Subject: specifier: properly size newly allocated string X-Git-Tag: 0.git+20100605+dfd8ee-1~39 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba3df95552b771d49ce488939366ea7efc56f38a;p=systemd specifier: properly size newly allocated string --- diff --git a/specifier.c b/specifier.c index a25f33a0..d8472e99 100644 --- a/specifier.c +++ b/specifier.c @@ -70,7 +70,7 @@ char *specifier_printf(const char *text, const Specifier table[], void *userdata j = t - r; k = strlen(w); - if (!(n = new(char, j + k + (l - (f - text)) + 1))) { + if (!(n = new(char, j + k + l + 1))) { free(r); free(w); return NULL;