Fix probable crash

This commit is contained in:
vdutta 2022-06-28 14:37:32 +05:30
parent bf2bf6f7c2
commit ebe5137382

View file

@ -671,10 +671,12 @@ end:
// Remove temporary file if ubus upgrade failed and file exists
if (!json_obj && file_exists(fw_image_path) && strncmp(url, FILE_URI, strlen(FILE_URI))) {
remove(fw_image_path);
json_object_put(json_obj);
res = -1;
}
if (json_obj != NULL)
json_object_put(json_obj);
return res;
}