Fix a typo in apps/pkcs12.c which was using the wrong part of
[openssl.git] / apps / s_socket.c
index ba10d76b2893cf163152815cc684eacd9a52245d..0238566a819696c665e2c4b4d66f0f87ad8b9af2 100644 (file)
@@ -80,7 +80,9 @@ typedef unsigned int u_int;
 #include <openssl/ssl.h>
 
 static struct hostent *GetHostByName(char *name);
+#ifdef WINDOWS
 static void sock_cleanup(void);
+#endif
 static int sock_init(void);
 static int init_client_ip(int *sock,unsigned char ip[4], int port);
 static int init_server(int *sock, int port);
@@ -130,17 +132,17 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
 #endif /* WIN32 */
 #endif /* WINDOWS */
 
+#ifdef WINDOWS
 static void sock_cleanup(void)
        {
-#ifdef WINDOWS
        if (wsa_init_done)
                {
                wsa_init_done=0;
                WSACancelBlockingCall();
                WSACleanup();
                }
-#endif
        }
+#endif
 
 static int sock_init(void)
        {
@@ -239,7 +241,7 @@ int do_server(int port, int *ret, int (*cb)(), char *context)
                        return(0);
                        }
                i=(*cb)(name,sock, context);
-               if (name != NULL) Free(name);
+               if (name != NULL) OPENSSL_free(name);
                SHUTDOWN2(sock);
                if (i < 0)
                        {
@@ -370,9 +372,9 @@ redoit:
                }
        else
                {
-               if ((*host=(char *)Malloc(strlen(h1->h_name)+1)) == NULL)
+               if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
                        {
-                       perror("Malloc");
+                       perror("OPENSSL_malloc");
                        return(0);
                        }
                strcpy(*host,h1->h_name);