diff options
author | minkikim89 <minkikim89@gmail.com> | 2019-10-09 04:49:05 +0200 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-10-22 15:52:08 -0700 |
commit | d85ff44a56c5c796a1896c43f30d96f0d30ff163 (patch) | |
tree | 7e8b9989488e141d266ee8f05ab8dce8b831cdb5 /restart.c | |
parent | 266d582c0a05a4fbed53ebbbc6625fc5b23a7faf (diff) | |
download | memcached-d85ff44a56c5c796a1896c43f30d96f0d30ff163.tar.gz |
restart: add error handling when a tag is not found in a metadata file.
Diffstat (limited to 'restart.c')
-rw-r--r-- | restart.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -82,6 +82,7 @@ static int restart_check(const char *file) { restart_cb_ctx ctx; ctx.f = f; + ctx.cb = NULL; ctx.line = NULL; ctx.done = false; if (restart_get_kv(&ctx, NULL, NULL) != RESTART_DONE) { @@ -91,6 +92,10 @@ static int restart_check(const char *file) { // TODO: this should probably just return -1 and skip the reuse. abort(); } + if (ctx.cb == NULL) { + fprintf(stderr, "[restart] Failed to read a tag from metadata file\n"); + abort(); + } // loop call the callback, check result code. bool failed = false; |