Fix (spurious) warnings.
[openssl.git] / crypto / dh / dhtest.c
index a3f4692eca9d76079ec821579d66ef5c59d7a4db..dbdb9638283ce6627deb38beaa9b8f6a55d6c822 100644 (file)
@@ -87,14 +87,14 @@ 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;
+       DH *a;
+       DH *b=NULL;
        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 +167,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);
        }
@@ -180,7 +183,7 @@ static void MS_CALLBACK cb(int p, int n, void *arg)
        if (p == 2) c='*';
        if (p == 3) c='\n';
        BIO_write((BIO *)arg,&c,1);
-       BIO_flush((BIO *)arg);
+       (void)BIO_flush((BIO *)arg);
 #ifdef LINT
        p=n;
 #endif