diff options
author | Matt Johnston <matt@ucc.asn.au> | 2020-06-10 23:16:13 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2020-06-10 23:16:13 +0800 |
commit | 4b305c5721f68e39320ca2e15b03a411da2305f1 (patch) | |
tree | 5b1698939cf893223f14cec77ed446f28a7d921a /libtomcrypt/demos/constants.c | |
parent | 615885be01188e433cf931e2f7f85394fdc31c5d (diff) |
Merge libtomcrypt v1.18.2
Diffstat (limited to 'libtomcrypt/demos/constants.c')
-rw-r--r-- | libtomcrypt/demos/constants.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libtomcrypt/demos/constants.c b/libtomcrypt/demos/constants.c index f747eb5..50485ad 100644 --- a/libtomcrypt/demos/constants.c +++ b/libtomcrypt/demos/constants.c @@ -65,9 +65,10 @@ int main(int argc, char **argv) /* get and print the length of the names (and values) list */ if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE); /* get and print the names (and values) list */ - names_list = malloc(names_list_len); + if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE); if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE); printf("%s\n", names_list); + free(names_list); } } else if (argc == 3) { if (strcmp(argv[1], "-s") == 0) { |