apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1089424 - /apr/apr/trunk/test/testsock.c
Date Wed, 06 Apr 2011 12:28:44 GMT
Author: trawick
Date: Wed Apr  6 12:28:43 2011
New Revision: 1089424

URL: http://svn.apache.org/viewvc?rev=1089424&view=rev
Log:
avoid segfault when setup_socket() fails

Modified:
    apr/apr/trunk/test/testsock.c

Modified: apr/apr/trunk/test/testsock.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testsock.c?rev=1089424&r1=1089423&r2=1089424&view=diff
==============================================================================
--- apr/apr/trunk/test/testsock.c (original)
+++ apr/apr/trunk/test/testsock.c Wed Apr  6 12:28:43 2011
@@ -346,6 +346,7 @@ static void test_get_addr(abts_case *tc,
     APR_ASSERT_SUCCESS(tc, "create subpool", apr_pool_create(&subp, p));
 
     ld = setup_socket(tc);
+    if (!ld) return;
 
     APR_ASSERT_SUCCESS(tc,
                        "get local address of bound socket",
@@ -446,6 +447,8 @@ static void test_wait(abts_case *tc, voi
     int connected = FALSE;
 
     server = setup_socket(tc);
+    if (!server) return;
+
     rv = apr_sockaddr_info_get(&server_addr, socket_name, socket_type, 8021, 0, p);
     APR_ASSERT_SUCCESS(tc, "setting up sockaddr", rv);
 



Mime
View raw message