X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Fxregex.c;h=ba22b7d598964c0efd9c95bc0d0606851b6d1713;hp=b0cd8b9cd9e8bcfef2072de0e01573e529c0db0c;hb=480538737a8a9be074a1848f2e52cf2d1ff4709f;hpb=acd905996191df6ab59050bd179a5ed11e6f72a4 diff --git a/libopkg/xregex.c b/libopkg/xregex.c index b0cd8b9..ba22b7d 100644 --- a/libopkg/xregex.c +++ b/libopkg/xregex.c @@ -18,6 +18,7 @@ #include "includes.h" #include "xregex.h" +#include "libbb/libbb.h" static void print_regcomp_err(const regex_t *preg, int err); @@ -39,10 +40,8 @@ static void print_regcomp_err(const regex_t *preg, int err) fprintf(stderr, "%s: Error compiling regex:", __FUNCTION__); size = regerror(err, preg, 0, 0); - error = calloc(1, size); - if (error) { - regerror(err, preg, error, size); - fprintf(stderr, "%s\n", error); - } + error = xcalloc(1, size); + regerror(err, preg, error, size); + fprintf(stderr, "%s\n", error); free(error); }