Skip to content

Commit b72a4e3

Browse files
Chenjpmarkt-asf
authored andcommitted
Fix buf size
Reduce unused mem
1 parent 4e87c9a commit b72a4e3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

native/src/ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSL, setCipherSuites)(TCN_STDARGS, jlong ssl,
11481148
* no matter what was given in the config.
11491149
*/
11501150
len = strlen(J2S(cipherList)) + strlen(SSL_CIPHERS_ALWAYS_DISABLED) + 1;
1151-
buf = malloc(len * sizeof(char *));
1151+
buf = malloc(len * sizeof(char));
11521152
if (buf == NULL) {
11531153
rv = JNI_FALSE;
11541154
goto free_cipherList;

native/src/sslcontext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, setCipherSuite)(TCN_STDARGS, jlong ctx,
541541
* no matter what was given in the config.
542542
*/
543543
len = strlen(J2S(cipherList)) + strlen(SSL_CIPHERS_ALWAYS_DISABLED) + 1;
544-
buf = malloc(len * sizeof(char *));
544+
buf = malloc(len * sizeof(char));
545545
if (buf == NULL) {
546546
rv = JNI_FALSE;
547547
goto free_cipherList;

0 commit comments

Comments
 (0)