]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: use realloc_multiply() where it makes sense
authorLennart Poettering <lennart@poettering.net>
Fri, 25 Nov 2016 17:58:31 +0000 (18:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Nov 2016 23:25:51 +0000 (00:25 +0100)
src/nspawn/nspawn-mount.c

index d72b0a0b9bdc978de6ff6f7b2d4785929d3da75a..9d76f4a381697a4bea60706cd9b81ea3f3e56ea3 100644 (file)
@@ -47,7 +47,7 @@ CustomMount* custom_mount_add(CustomMount **l, unsigned *n, CustomMountType t) {
         assert(t >= 0);
         assert(t < _CUSTOM_MOUNT_TYPE_MAX);
 
-        c = realloc(*l, (*n + 1) * sizeof(CustomMount));
+        c = realloc_multiply(*l, (*n + 1), sizeof(CustomMount));
         if (!c)
                 return NULL;