diff options
author | Bodo Möller <bodo@openssl.org> | 2001-03-15 11:30:10 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-03-15 11:30:10 +0000 |
commit | 5d8094143e466edbfb830d27a930fa40c46389b2 (patch) | |
tree | 8fd88422feef44bfde8cfe689408333cd9bfd998 /crypto/err | |
parent | bb6dcb54f98203b01759b005396d605eb08b43b3 (diff) | |
download | openssl-5d8094143e466edbfb830d27a930fa40c46389b2.tar.gz |
More error_data memory leaks
Diffstat (limited to 'crypto/err')
-rw-r--r-- | crypto/err/err.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index 06d1ef9c4a..b4183a7f71 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -391,20 +391,18 @@ void ERR_put_error(int lib, int func, int reason, const char *file, void ERR_clear_error(void) { + int i; ERR_STATE *es; es=ERR_get_state(); -#if 0 - /* hmm... is this needed */ for (i=0; i<ERR_NUM_ERRORS; i++) { es->err_buffer[i]=0; + err_clear_data(es,i); es->err_file[i]=NULL; es->err_line[i]= -1; - err_clear_data(es,i); } -#endif es->top=es->bottom=0; } @@ -764,8 +762,9 @@ void ERR_set_error_data(char *data, int flags) if (i == 0) i=ERR_NUM_ERRORS-1; + err_clear_data(es,i); es->err_data[i]=data; - es->err_data_flags[es->top]=flags; + es->err_data_flags[i]=flags; } void ERR_add_error_data(int num, ...) @@ -774,7 +773,7 @@ void ERR_add_error_data(int num, ...) int i,n,s; char *str,*p,*a; - s=64; + s=80; str=OPENSSL_malloc(s+1); if (str == NULL) return; str[0]='\0'; |