diff options
Diffstat (limited to 'libextra/gnutls_srp.c')
-rw-r--r-- | libextra/gnutls_srp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libextra/gnutls_srp.c b/libextra/gnutls_srp.c index b05558eda9..b6d3439635 100644 --- a/libextra/gnutls_srp.c +++ b/libextra/gnutls_srp.c @@ -435,21 +435,21 @@ int i; return GNUTLS_E_FILE_ERROR; } - res->password_file = gnutls_realloc( res->password_file, + res->password_file = gnutls_realloc_fast( res->password_file, sizeof(char*)*(res->password_files+1)); if (res->password_file==NULL) { gnutls_assert(); return GNUTLS_E_MEMORY_ERROR; } - res->password_conf_file = gnutls_realloc( res->password_conf_file, + res->password_conf_file = gnutls_realloc_fast( res->password_conf_file, sizeof(char*)*(res->password_files+1)); if (res->password_conf_file==NULL) { gnutls_assert(); return GNUTLS_E_MEMORY_ERROR; } - i = res->password_files++; + i = res->password_files; res->password_file[i] = gnutls_strdup( password_file); if (res->password_file[i]==NULL) { @@ -461,9 +461,12 @@ int i; if (res->password_conf_file[i]==NULL) { gnutls_assert(); gnutls_free(res->password_file[i]); + res->password_file[i] = NULL; return GNUTLS_E_MEMORY_ERROR; } + res->password_files++; + return 0; } |