Properly own the duplicated string
[openssl.git] / crypto / dh / dh_depr.c
index 7220d074d88873f83a2b11b85f8dc8c9683c6745..90ce0b0d89e5ffaa735a16111a09733c57026560 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/dh/dh_depr.c */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
 
 /* This file contains deprecated functions as wrappers to the new ones */
 
-#include <stdio.h>
-#include "cryptlib.h"
-#include <openssl/bn.h>
-#include <openssl/dh.h>
+#include <openssl/opensslconf.h>
+#if OPENSSL_API_COMPAT >= 0x00908000L
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-static void *dummy = &dummy;
+# include <stdio.h>
+# include "internal/cryptlib.h"
+# include <openssl/bn.h>
+# include <openssl/dh.h>
 
-#ifndef OPENSSL_NO_DEPRECATED
 DH *DH_generate_parameters(int prime_len, int generator,
                            void (*callback) (int, int, void *), void *cb_arg)
 {
@@ -72,7 +73,7 @@ DH *DH_generate_parameters(int prime_len, int generator,
     if ((ret = DH_new()) == NULL)
         return NULL;
     cb = BN_GENCB_new();
-    if (!cb) {
+    if (cb == NULL) {
         DH_free(ret);
         return NULL;
     }