Skip to content

Commit c2b23d1

Browse files
Merge pull request tensorflow#26582 from siju-samuel:patch-46
PiperOrigin-RevId: 241038747
2 parents 6815ac3 + aa41f70 commit c2b23d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tensorflow/lite/core/subgraph.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,14 @@ TfLiteStatus Subgraph::AddNodeWithParameters(
529529
const std::vector<int>& inputs, const std::vector<int>& outputs,
530530
const char* init_data, size_t init_data_size, void* builtin_data,
531531
const TfLiteRegistration* registration, int* node_index) {
532+
std::unique_ptr<void, decltype(free)*> builtin_data_deleter(builtin_data,
533+
free);
532534
if (state_ == kStateInvokableAndImmutable) {
533535
ReportError("AddNodeWithParameters is disallowed when graph is immutable.");
534536
return kTfLiteError;
535537
}
536538
state_ = kStateUninvokable;
537539

538-
std::unique_ptr<void, decltype(free)*> builtin_data_deleter(builtin_data,
539-
free);
540-
541540
TF_LITE_ENSURE_OK(context_, CheckTensorIndices("node inputs", inputs.data(),
542541
inputs.size()));
543542
TF_LITE_ENSURE_OK(

0 commit comments

Comments
 (0)