Skip to content

Commit

Permalink
Fix invalid use of info after deletion (#5462)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccorm4 authored Mar 7, 2023
1 parent bada50c commit 1b0fe1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http_server.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright 2019-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -1069,13 +1069,14 @@ HTTPAPIServer::InferResponseAlloc(
// ...then make sure shared memory size is at least as big as
// the size of the output.
if (byte_size > info->byte_size_) {
const auto info_byte_size = info->byte_size_;
delete info;
return TRITONSERVER_ErrorNew(
TRITONSERVER_ERROR_INTERNAL,
std::string(
"shared memory size specified with the request for output '" +
std::string(tensor_name) + "' (" +
std::to_string(info->byte_size_) + " bytes) should be at least " +
std::to_string(info_byte_size) + " bytes) should be at least " +
std::to_string(byte_size) + " bytes to hold the results")
.c_str());
}
Expand Down

0 comments on commit 1b0fe1f

Please sign in to comment.