realloc(NULL, size) behaves the same as malloc(size) so there is no need to distinguish between the two. Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx> --- mount/lomount.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/mount/lomount.c b/mount/lomount.c index 54b9f8e..4cbc3bf 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -259,8 +259,7 @@ loop_scandir(const char *dirname, int **ary, int hasprefix) continue; if (count + 1 > arylen) { arylen += 1; - *ary = *ary ? realloc(*ary, arylen * sizeof(int)) : - malloc(arylen * sizeof(int)); + *ary = realloc(*ary, arylen * sizeof(int)); if (!*ary) return -1; } -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html