common/params.cc: unlink tmp_path only if there's an error (#32145)

old-commit-hash: c1edc0901e
pull/32199/head
Dean Lee 1 year ago committed by GitHub
parent b5ccf4ba02
commit 9e67d3fd70
  1. 4
      common/params.cc

@ -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;
}

Loading…
Cancel
Save