Skip to content

Commit 28c6784

Browse files
committed
Deallocate after using the downloaded data
1 parent 4bf0cd7 commit 28c6784

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/scitokens_internal.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,10 @@ Validator::get_public_keys_from_web_continue(std::unique_ptr<AsyncStatus> status
655655
}
656656

657657
status->m_cget->get_data(buffer, len);
658-
status->m_cget.reset();
659658
auto metadata = std::string(buffer, len);
660659
picojson::value json_obj;
661660
auto err = picojson::parse(json_obj, metadata);
661+
status->m_cget.reset();
662662
if (!err.empty()) {
663663
throw JsonException(err);
664664
}
@@ -674,13 +674,12 @@ Validator::get_public_keys_from_web_continue(std::unique_ptr<AsyncStatus> status
674674
status->m_continue_fetch = false;
675675
status->m_done = true;
676676
status->m_state = AsyncStatus::DONE;
677-
return std::move(status);
678677
}
679678
case AsyncStatus::DONE:
680679
status->m_done = true;
681-
return std::move(status);
682680

683681
} // Switch
682+
return std::move(status);
684683
}
685684

686685
std::string

0 commit comments

Comments
 (0)