mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 14:32:07 +08:00
common/params.cc: unlink tmp_path only if there's an error (#32145)
This commit is contained in:
+3
-1
@@ -273,7 +273,9 @@ int Params::put(const char* key, const char* value, size_t value_size) {
|
||||
} while (false);
|
||||
|
||||
close(tmp_fd);
|
||||
::unlink(tmp_path.c_str());
|
||||
if (result != 0) {
|
||||
::unlink(tmp_path.c_str());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user