summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-02 00:10:44 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-02 00:10:44 +0100
commit9ff233dc1fa2f47fc4499a12a8ee0640aba30657 (patch)
tree6118980c496c0ce37bb2109e07b965bbaecce03a
parent49bfc8774bf900fb2239a9b70b951aedccbfed5a (diff)
hexdecoct: use typesafe new() instead of malloc()
-rw-r--r--src/basic/hexdecoct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/hexdecoct.c b/src/basic/hexdecoct.c
index 6843aedd0a..2d6e377f0a 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;