From: Lennart Poettering Date: Wed, 1 Feb 2017 23:10:44 +0000 (+0100) Subject: hexdecoct: use typesafe new() instead of malloc() X-Git-Tag: v233~181^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5203%2Fhead;p=thirdparty%2Fsystemd.git hexdecoct: use typesafe new() instead of malloc() --- diff --git a/src/basic/hexdecoct.c b/src/basic/hexdecoct.c index 6843aedd0a2..2d6e377f0a4 100644 --- a/src/basic/hexdecoct.c +++ b/src/basic/hexdecoct.c @@ -72,10 +72,10 @@ int unhexchar(char c) { } char *hexmem(const void *p, size_t l) { - char *r, *z; const uint8_t *x; + char *r, *z; - z = r = malloc(l * 2 + 1); + z = r = new(char, l * 2 + 1); if (!r) return NULL;