Skip to content

Commit 3123a93

Browse files
committed
A C arrary of char's has size nelements * sizeof(char *),
not nelements * sizeof(char **), even though the result is likely the same on any platform we'll ever see.
1 parent ee8d161 commit 3123a93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scitokens.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int scitoken_get_claim_string_list(const SciToken token, const char *key, char *
140140
if (err_msg) {*err_msg = strdup(exc.what());}
141141
return -1;
142142
}
143-
auto claim_list_c = static_cast<char **>(malloc(sizeof(char **) * (claim_list.size() + 1)));
143+
auto claim_list_c = static_cast<char **>(malloc(sizeof(char *) * (claim_list.size() + 1)));
144144
claim_list_c[claim_list.size()] = nullptr;
145145
int idx = 0;
146146
for (const auto &entry : claim_list) {

0 commit comments

Comments
 (0)