Skip to content
Snippets Groups Projects
Commit 358dc7db authored by David Vasek's avatar David Vasek Committed by Daniel Salzman
Browse files

backup: code robustness improvement

parent 00c352f0
No related branches found
No related tags found
No related merge requests found
Pipeline #132578 passed
...@@ -170,7 +170,7 @@ static int get_backup_format(zone_backup_ctx_t *ctx) ...@@ -170,7 +170,7 @@ static int get_backup_format(zone_backup_ctx_t *ctx)
{ {
PREPARE_PATH(label_path, label_file_name); PREPARE_PATH(label_path, label_file_name);
int ret = KNOT_EMALF; int ret;
struct stat sb; struct stat sb;
if (stat(label_path, &sb) != 0) { if (stat(label_path, &sb) != 0) {
...@@ -211,6 +211,7 @@ static int get_backup_format(zone_backup_ctx_t *ctx) ...@@ -211,6 +211,7 @@ static int get_backup_format(zone_backup_ctx_t *ctx)
} }
if (strcmp(line, label_file_head) != 0) { if (strcmp(line, label_file_head) != 0) {
ret = KNOT_EMALF;
goto done; goto done;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment