fix: free key when adding paste
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
parent
425695596b
commit
91bba2e9ff
|
@ -126,13 +126,17 @@ int main() {
|
|||
file.open(std::string("pastes/") + key, std::ios_base::out);
|
||||
|
||||
if (!file.is_open()) {
|
||||
free(key);
|
||||
return crow::response(crow::status::INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
file << req.body;
|
||||
file.close();
|
||||
|
||||
return crow::response(base_url + key);
|
||||
std::string res = base_url + key;
|
||||
free(key);
|
||||
|
||||
return crow::response(res);
|
||||
});
|
||||
|
||||
app.port(18080).multithreaded().run();
|
||||
|
|
Loading…
Reference in New Issue