summaryrefslogtreecommitdiffstats
path: root/src/redis-check-aof.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-04 17:58:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-04 17:58:42 +0000
commitd6a20015c95e2a15f0f8dc6fcd73d3f5695e32e7 (patch)
tree9932358072ca6e6beb6854aba698ecbb3b5532aa /src/redis-check-aof.c
parentReleasing progress-linux version 5:7.2.4-1~progress7.99u1. (diff)
downloadredis-d6a20015c95e2a15f0f8dc6fcd73d3f5695e32e7.tar.xz
redis-d6a20015c95e2a15f0f8dc6fcd73d3f5695e32e7.zip
Merging upstream version 5:7.2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/redis-check-aof.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/redis-check-aof.c b/src/redis-check-aof.c
index 616177a..e28126d 100644
--- a/src/redis-check-aof.c
+++ b/src/redis-check-aof.c
@@ -233,6 +233,7 @@ int checkSingleAof(char *aof_filename, char *aof_filepath, int last_file, int fi
struct redis_stat sb;
if (redis_fstat(fileno(fp),&sb) == -1) {
printf("Cannot stat file: %s, aborting...\n", aof_filename);
+ fclose(fp);
exit(1);
}
@@ -343,6 +344,7 @@ int fileIsRDB(char *filepath) {
struct redis_stat sb;
if (redis_fstat(fileno(fp), &sb) == -1) {
printf("Cannot stat file: %s\n", filepath);
+ fclose(fp);
exit(1);
}
@@ -379,6 +381,7 @@ int fileIsManifest(char *filepath) {
struct redis_stat sb;
if (redis_fstat(fileno(fp), &sb) == -1) {
printf("Cannot stat file: %s\n", filepath);
+ fclose(fp);
exit(1);
}
@@ -395,15 +398,20 @@ int fileIsManifest(char *filepath) {
break;
} else {
printf("Cannot read file: %s\n", filepath);
+ fclose(fp);
exit(1);
}
}
- /* Skip comments lines */
+ /* We will skip comments lines.
+ * At present, the manifest format is fixed, see aofInfoFormat.
+ * We will break directly as long as it encounters other items. */
if (buf[0] == '#') {
continue;
} else if (!memcmp(buf, "file", strlen("file"))) {
is_manifest = 1;
+ } else {
+ break;
}
}