Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CID 1565414, 1565415: use std::move() instead of copying. #2291

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/rnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4434,7 +4434,7 @@ parse_preferences(json_object *jso, rnp::UserPrefs &prefs)
/* Preferred key server */
std::string key_server;
if (json_get_str(jso, "key server", key_server)) {
prefs.key_server = key_server;
prefs.key_server = std::move(key_server);
}
/* Do not allow extra unknown keys */
return !json_object_object_length(jso);
Expand Down Expand Up @@ -4571,7 +4571,7 @@ parse_keygen_primary(rnp_ffi_t ffi,
if (str.size() > MAX_ID_LENGTH) {
return nullptr;
}
cert.userid = str;
cert.userid = std::move(str);
}
/* Preferences */
auto obj = json_get_obj(jso, "preferences");
Expand Down
Loading