chiark / gitweb /
Prep v234: Apply missing upstream fixes in src/basic (1/6)
[elogind.git] / src / basic / hexdecoct.c
index 6843aedd0a2b781bcd2821ace0a5584936a3252d..2d6e377f0a4062cbdc693d103bfb45a21a3c4b63 100644 (file)
@@ -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;