]> arthur.barton.de Git - bup.git/commitdiff
bup: remove redundant allocation doubling
authorRob Browning <rlb@defaultvalue.org>
Sat, 4 Sep 2021 19:08:02 +0000 (14:08 -0500)
committerRob Browning <rlb@defaultvalue.org>
Thu, 9 Sep 2021 07:05:36 +0000 (02:05 -0500)
Thanks to Johannes Berg for pointing out the issue.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/cmd/bup.c

index 33b8077f7f772a00fd8f99d43615a5fefb432ecd..61e88dbbea2414ed535ffcd7e31df59453d6ccb9 100644 (file)
@@ -271,7 +271,6 @@ static char *exe_parent_dir(const char * const argv_0)
                 break;
             if (!INT_MULTIPLY_OK(path_n, 2, &path_n))
                 die(2, "memory buffer for executable path would be too big\n");
-            path_n *= 2;
             if (path != sbuf) free(path);
             path = malloc(path_n);
             if (!path)