From 50a6998d597fd2e6c5cd23a182e7e47d18cf71e1 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Wed, 3 Jan 2024 20:51:22 +0300 Subject: [PATCH] reverse-ramdisk.c: fix fail condition after realloc --- c-programming/reverse-ramdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index f44280b..5cb1a0e 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -150,7 +150,7 @@ int tf_free(int ID) { // Reallocate memory for the temp_files array temp_files = realloc(temp_files, num_temp_files * sizeof(TempFile)); - if (temp_files == NULL && num_temp_files > 0) { + if (temp_files == NULL) { line_fail(-2); return -1; }