]> granicus.if.org Git - openssl/commitdiff
add va_list version of ERR_add_error_data
authorDr. Stephen Henson <steve@openssl.org>
Fri, 14 Jan 2011 15:13:59 +0000 (15:13 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 14 Jan 2011 15:13:59 +0000 (15:13 +0000)
crypto/err/err.c
crypto/err/err.h

index 69713a6e2ff1b52b780a517357743e4530905be6..fcdb244008f66d0f8ca10e2947092307b82e2003 100644 (file)
@@ -1066,6 +1066,13 @@ void ERR_set_error_data(char *data, int flags)
 void ERR_add_error_data(int num, ...)
        {
        va_list args;
+       va_start(args, num);
+       ERR_add_error_vdata(num, args);
+       va_end(args);
+       }
+
+void ERR_add_error_vdata(int num, va_list args)
+       {
        int i,n,s;
        char *str,*p,*a;
 
@@ -1074,7 +1081,6 @@ void ERR_add_error_data(int num, ...)
        if (str == NULL) return;
        str[0]='\0';
 
-       va_start(args, num);
        n=0;
        for (i=0; i<num; i++)
                {
@@ -1090,7 +1096,7 @@ void ERR_add_error_data(int num, ...)
                                if (p == NULL)
                                        {
                                        OPENSSL_free(str);
-                                       goto err;
+                                       return;
                                        }
                                else
                                        str=p;
@@ -1099,9 +1105,6 @@ void ERR_add_error_data(int num, ...)
                        }
                }
        ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
-
-err:
-       va_end(args);
        }
 
 int ERR_set_mark(void)
index b9f8c16d47d299b11b16d1843fafc283332f4067..974cc9cc6f903129936edccff2d8ea78cdf5638b 100644 (file)
@@ -344,8 +344,9 @@ void ERR_print_errors_fp(FILE *fp);
 #endif
 #ifndef OPENSSL_NO_BIO
 void ERR_print_errors(BIO *bp);
-void ERR_add_error_data(int num, ...);
 #endif
+void ERR_add_error_data(int num, ...);
+void ERR_add_error_vdata(int num, va_list args);
 void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
 void ERR_unload_strings(int lib,ERR_STRING_DATA str[]);
 void ERR_load_ERR_strings(void);