Skip to content

Commit 1b0fe1f

Browse files
authored
Fix invalid use of info after deletion (#5462)
1 parent bada50c commit 1b0fe1f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/http_server.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
// Copyright 2019-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
//
33
// Redistribution and use in source and binary forms, with or without
44
// modification, are permitted provided that the following conditions
@@ -1069,13 +1069,14 @@ HTTPAPIServer::InferResponseAlloc(
10691069
// ...then make sure shared memory size is at least as big as
10701070
// the size of the output.
10711071
if (byte_size > info->byte_size_) {
1072+
const auto info_byte_size = info->byte_size_;
10721073
delete info;
10731074
return TRITONSERVER_ErrorNew(
10741075
TRITONSERVER_ERROR_INTERNAL,
10751076
std::string(
10761077
"shared memory size specified with the request for output '" +
10771078
std::string(tensor_name) + "' (" +
1078-
std::to_string(info->byte_size_) + " bytes) should be at least " +
1079+
std::to_string(info_byte_size) + " bytes) should be at least " +
10791080
std::to_string(byte_size) + " bytes to hold the results")
10801081
.c_str());
10811082
}

0 commit comments

Comments
 (0)