diff options
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 32 | 
1 files changed, 16 insertions, 16 deletions
| diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 6113060aa9..d3cadd51f6 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c | |||
| @@ -77,7 +77,7 @@ UI *UI_new_method(const UI_METHOD *method) | |||
| 77 | { | 77 | { | 
| 78 | UI *ret; | 78 | UI *ret; | 
| 79 | 79 | ||
| 80 | ret=(UI *)OPENSSL_malloc(sizeof(UI)); | 80 | ret=(UI *)malloc(sizeof(UI)); | 
| 81 | if (ret == NULL) | 81 | if (ret == NULL) | 
| 82 | { | 82 | { | 
| 83 | UIerr(UI_F_UI_NEW_METHOD,ERR_R_MALLOC_FAILURE); | 83 | UIerr(UI_F_UI_NEW_METHOD,ERR_R_MALLOC_FAILURE); | 
| @@ -99,19 +99,19 @@ static void free_string(UI_STRING *uis) | |||
| 99 | { | 99 | { | 
| 100 | if (uis->flags & OUT_STRING_FREEABLE) | 100 | if (uis->flags & OUT_STRING_FREEABLE) | 
| 101 | { | 101 | { | 
| 102 | OPENSSL_free((char *)uis->out_string); | 102 | free((char *)uis->out_string); | 
| 103 | switch(uis->type) | 103 | switch(uis->type) | 
| 104 | { | 104 | { | 
| 105 | case UIT_BOOLEAN: | 105 | case UIT_BOOLEAN: | 
| 106 | OPENSSL_free((char *)uis->_.boolean_data.action_desc); | 106 | free((char *)uis->_.boolean_data.action_desc); | 
| 107 | OPENSSL_free((char *)uis->_.boolean_data.ok_chars); | 107 | free((char *)uis->_.boolean_data.ok_chars); | 
| 108 | OPENSSL_free((char *)uis->_.boolean_data.cancel_chars); | 108 | free((char *)uis->_.boolean_data.cancel_chars); | 
| 109 | break; | 109 | break; | 
| 110 | default: | 110 | default: | 
| 111 | break; | 111 | break; | 
| 112 | } | 112 | } | 
| 113 | } | 113 | } | 
| 114 | OPENSSL_free(uis); | 114 | free(uis); | 
| 115 | } | 115 | } | 
| 116 | 116 | ||
| 117 | void UI_free(UI *ui) | 117 | void UI_free(UI *ui) | 
| @@ -120,7 +120,7 @@ void UI_free(UI *ui) | |||
| 120 | return; | 120 | return; | 
| 121 | sk_UI_STRING_pop_free(ui->strings,free_string); | 121 | sk_UI_STRING_pop_free(ui->strings,free_string); | 
| 122 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_UI, ui, &ui->ex_data); | 122 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_UI, ui, &ui->ex_data); | 
| 123 | OPENSSL_free(ui); | 123 | free(ui); | 
| 124 | } | 124 | } | 
| 125 | 125 | ||
| 126 | static int allocate_string_stack(UI *ui) | 126 | static int allocate_string_stack(UI *ui) | 
| @@ -151,7 +151,7 @@ static UI_STRING *general_allocate_prompt(UI *ui, const char *prompt, | |||
| 151 | { | 151 | { | 
| 152 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,UI_R_NO_RESULT_BUFFER); | 152 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,UI_R_NO_RESULT_BUFFER); | 
| 153 | } | 153 | } | 
| 154 | else if ((ret = (UI_STRING *)OPENSSL_malloc(sizeof(UI_STRING)))) | 154 | else if ((ret = (UI_STRING *)malloc(sizeof(UI_STRING)))) | 
| 155 | { | 155 | { | 
| 156 | ret->out_string=prompt; | 156 | ret->out_string=prompt; | 
| 157 | ret->flags=prompt_freeable ? OUT_STRING_FREEABLE : 0; | 157 | ret->flags=prompt_freeable ? OUT_STRING_FREEABLE : 0; | 
| @@ -354,10 +354,10 @@ int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, | |||
| 354 | ok_chars_copy, cancel_chars_copy, 1, UIT_BOOLEAN, flags, | 354 | ok_chars_copy, cancel_chars_copy, 1, UIT_BOOLEAN, flags, | 
| 355 | result_buf); | 355 | result_buf); | 
| 356 | err: | 356 | err: | 
| 357 | if (prompt_copy) OPENSSL_free(prompt_copy); | 357 | if (prompt_copy) free(prompt_copy); | 
| 358 | if (action_desc_copy) OPENSSL_free(action_desc_copy); | 358 | if (action_desc_copy) free(action_desc_copy); | 
| 359 | if (ok_chars_copy) OPENSSL_free(ok_chars_copy); | 359 | if (ok_chars_copy) free(ok_chars_copy); | 
| 360 | if (cancel_chars_copy) OPENSSL_free(cancel_chars_copy); | 360 | if (cancel_chars_copy) free(cancel_chars_copy); | 
| 361 | return -1; | 361 | return -1; | 
| 362 | } | 362 | } | 
| 363 | 363 | ||
| @@ -430,7 +430,7 @@ char *UI_construct_prompt(UI *ui, const char *object_desc, | |||
| 430 | len += sizeof(prompt2) - 1 + strlen(object_name); | 430 | len += sizeof(prompt2) - 1 + strlen(object_name); | 
| 431 | len += sizeof(prompt3) - 1; | 431 | len += sizeof(prompt3) - 1; | 
| 432 | 432 | ||
| 433 | prompt = (char *)OPENSSL_malloc(len + 1); | 433 | prompt = (char *)malloc(len + 1); | 
| 434 | BUF_strlcpy(prompt, prompt1, len + 1); | 434 | BUF_strlcpy(prompt, prompt1, len + 1); | 
| 435 | BUF_strlcat(prompt, object_desc, len + 1); | 435 | BUF_strlcat(prompt, object_desc, len + 1); | 
| 436 | if (object_name) | 436 | if (object_name) | 
| @@ -618,7 +618,7 @@ const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth) | |||
| 618 | 618 | ||
| 619 | UI_METHOD *UI_create_method(char *name) | 619 | UI_METHOD *UI_create_method(char *name) | 
| 620 | { | 620 | { | 
| 621 | UI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD)); | 621 | UI_METHOD *ui_method = (UI_METHOD *)malloc(sizeof(UI_METHOD)); | 
| 622 | 622 | ||
| 623 | if (ui_method) | 623 | if (ui_method) | 
| 624 | { | 624 | { | 
| @@ -633,9 +633,9 @@ UI_METHOD *UI_create_method(char *name) | |||
| 633 | anything Murphy can throw at you and more! You have been warned. */ | 633 | anything Murphy can throw at you and more! You have been warned. */ | 
| 634 | void UI_destroy_method(UI_METHOD *ui_method) | 634 | void UI_destroy_method(UI_METHOD *ui_method) | 
| 635 | { | 635 | { | 
| 636 | OPENSSL_free(ui_method->name); | 636 | free(ui_method->name); | 
| 637 | ui_method->name = NULL; | 637 | ui_method->name = NULL; | 
| 638 | OPENSSL_free(ui_method); | 638 | free(ui_method); | 
| 639 | } | 639 | } | 
| 640 | 640 | ||
| 641 | int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)) | 641 | int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)) | 
