Improve support for running everything as a monolithic application.
[openssl.git] / crypto / dh / dhtest.c
index 770331971f2ffd09fe0b9553c128c58ee8b2742d..687ce71611aef5caee3719c68ba2a4b40ac6d033 100644 (file)
@@ -87,14 +87,13 @@ static void MS_CALLBACK cb(int p, int n, void *arg);
 #include "bss_file.c"
 #endif
 
-BIO *out=NULL;
-
 int main(int argc, char *argv[])
        {
        DH *a,*b;
        char buf[12];
        unsigned char *abuf=NULL,*bbuf=NULL;
        int i,alen,blen,aout,bout,ret=1;
+       BIO *out;
 
 #ifdef WIN32
        CRYPTO_malloc_init();
@@ -167,6 +166,9 @@ int main(int argc, char *argv[])
 err:
        if (abuf != NULL) Free(abuf);
        if (bbuf != NULL) Free(bbuf);
+       if(b != NULL) DH_free(b);
+       if(a != NULL) DH_free(a);
+       BIO_free(out);
        exit(ret);
        return(ret);
        }