Commit 4a34d18f authored by Jimmy Brisson's avatar Jimmy Brisson Committed by Manish Pandey
Browse files

Free arguments copied with strdup



Change-Id: I0ad9620145c2a9c4450b9bf20cd1f70c9db6593c
Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@arm.com>
parent 1f111f12
...@@ -593,5 +593,32 @@ int main(int argc, char *argv[]) ...@@ -593,5 +593,32 @@ int main(int argc, char *argv[])
#endif #endif
CRYPTO_cleanup_all_ex_data(); CRYPTO_cleanup_all_ex_data();
/* We allocated strings through strdup, so now we have to free them */
for (i = 0; i < num_keys; i++) {
if (keys[i].fn != NULL) {
void *ptr = keys[i].fn;
keys[i].fn = NULL;
free(ptr);
}
}
for (i = 0; i < num_extensions; i++) {
if (extensions[i].arg != NULL) {
void *ptr = (void *)extensions[i].arg;
extensions[i].arg = NULL;
free(ptr);
}
}
for (i = 0; i < num_certs; i++) {
if (certs[i].fn != NULL) {
void *ptr = (void *)certs[i].fn;
certs[i].fn = NULL;
free(ptr);
}
}
return 0; return 0;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment