diff options
author | Richard Levitte <levitte@openssl.org> | 2001-06-24 07:00:41 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-06-24 07:00:41 +0000 |
commit | 54c7559a7e2e3568923adfb7138e5645e3275932 (patch) | |
tree | 5bf7a63278fcd77fe831a927ecc0eefcdace2e62 | |
parent | 0c9de428ae03a3dd9272aba90c595f6c25a4525d (diff) | |
download | openssl-54c7559a7e2e3568923adfb7138e5645e3275932.tar.gz |
Make sure we don't return 0 on error.
-rw-r--r-- | crypto/ui/ui_lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 2559ea54b6..932658e2b7 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -176,6 +176,8 @@ static int general_allocate_string(UI *ui, const char *prompt, s->_.string_data.result_maxsize=maxsize; s->_.string_data.test_buf=test_buf; ret=sk_UI_STRING_push(ui->strings, s); + /* sk_push() returns 0 on error. Let's addapt that */ + if (ret <= 0) ret--; } else free_string(s); @@ -223,6 +225,9 @@ static int general_allocate_boolean(UI *ui, s->_.boolean_data.ok_chars = ok_chars; s->_.boolean_data.cancel_chars = cancel_chars; ret=sk_UI_STRING_push(ui->strings, s); + /* sk_push() returns 0 on error. + Let's addapt that */ + if (ret <= 0) ret--; } else free_string(s); |