From 89f6dcf845cb433960f2159610c447d6977776b9 Mon Sep 17 00:00:00 2001 From: smitsohu Date: Sat, 13 Oct 2018 21:47:17 +0200 Subject: improve clean_pathname() function: drop realloc rf. previous commit a5b7a9a8bec6a7f2162850449b1ff29c1fde2826 freeing what is expected to be a single byte only is most probably not worth the effort --- src/firejail/util.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/firejail/util.c b/src/firejail/util.c index 0d1418b43..61330a87e 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c @@ -560,13 +560,6 @@ char *clean_pathname(const char *path) { // remove a trailing slash if (j > 1 && rv[j - 1] == '/') rv[j - 1] = '\0'; - - size_t new_len = strlen(rv); - if (new_len < len) { - rv = realloc(rv, new_len + 1); - if (!rv) - errExit("realloc"); - } } return rv; -- cgit v1.2.3-54-g00ecf