Index: /pjproject/trunk/pjlib/src/pjlib-test/sock.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 509)
@@ -97,9 +97,9 @@
 
     /* pj_inet_ntoa() */
-    p = pj_inet_ntoa(addr);
+    p = (unsigned char*) pj_inet_ntoa(addr);
     if (!p)
 	return -20;
 
-    if (pj_strcmp2(&s, p) != 0)
+    if (pj_strcmp2(&s, (char*)p) != 0)
 	return -30;
 
Index: /pjproject/trunk/pjlib/src/pjlib-test/test.h
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 509)
@@ -22,9 +22,9 @@
 #include <pj/types.h>
 
-#define GROUP_LIBC                  0
-#define GROUP_OS                    0
-#define GROUP_DATA_STRUCTURE        0
-#define GROUP_NETWORK               0
-#define GROUP_FILE                  0
+#define GROUP_LIBC                  1
+#define GROUP_OS                    1
+#define GROUP_DATA_STRUCTURE        1
+#define GROUP_NETWORK               1
+#define GROUP_FILE                  1
 
 #define INCLUDE_ERRNO_TEST          GROUP_LIBC
Index: /pjproject/trunk/pjlib/src/pjlib-test/thread.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/thread.c	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/thread.c	(revision 509)
@@ -73,7 +73,8 @@
     pj_thread_desc desc;
     pj_thread_t *this_thread;
-    unsigned id = *pcounter;
+    unsigned id;
     pj_status_t rc;
 
+    id = *pcounter;
     TRACE__((THIS_FILE, "     thread %d running..", id));
 
Index: /pjproject/trunk/pjlib/src/pjlib-test/timestamp.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/timestamp.c	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/timestamp.c	(revision 509)
@@ -196,5 +196,5 @@
     }
 
-    sleep(0);
+    pj_thread_sleep(0);
 
     /* Mark end time. */
Index: /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 509)
@@ -150,4 +150,5 @@
         rc = pj_ioqueue_poll(ioqueue, &timeout);
     }
+    return 0;
 }
 
Index: /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 508)
+++ /pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c	(revision 509)
@@ -56,4 +56,5 @@
         }
     }
+    return 0;
 }
 
@@ -159,4 +160,5 @@
         }
     }
+    return 0;
 }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c	(revision 508)
+++ /pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c	(revision 509)
@@ -962,5 +962,5 @@
     int temp, nativeFormat;
     int sr = (int)sampleRate;
-    PaSampleFormat availableFormats, hostFormat;
+    PaSampleFormat availableFormats = 0, hostFormat;
     int chans = component->userChannelCount;
     int frgmt;
@@ -1165,5 +1165,5 @@
     const PaDeviceInfo *inputDeviceInfo = 0, *outputDeviceInfo = 0;
     int bpInitialized = 0;
-    double inLatency, outLatency;
+    double inLatency=0, outLatency=0;
 
     /* validate platform specific flags */
@@ -1523,5 +1523,5 @@
     PaError result = paNoError;
     PaOssStream *stream = (PaOssStream*)userData;
-    unsigned long framesAvail, framesProcessed;
+    unsigned long framesAvail=0, framesProcessed;
     int callbackResult = paContinue;
     int triggered = stream->triggered;  /* See if SNDCTL_DSP_TRIGGER has been issued already */
Index: /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 508)
+++ /pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 509)
@@ -905,5 +905,5 @@
 	}
     } else {
-	pjmedia_sdp_session *answer;
+	pjmedia_sdp_session *answer = NULL;
 
 	status = create_answer(pool, neg->neg_local_sdp, neg->neg_remote_sdp,
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 508)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 509)
@@ -650,10 +650,8 @@
     pj_status_t status;
 
-    PJSUA_LOCK();
-
     status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &sock);
     if (status != PJ_SUCCESS) {
 	pjsua_perror(THIS_FILE, "socket() error", status);
-	goto on_return;
+	return status;
     }
 
@@ -662,5 +660,5 @@
 	pjsua_perror(THIS_FILE, "bind() error", status);
 	pj_sock_close(sock);
-	goto on_return;
+	return status;
     }
 
@@ -686,5 +684,5 @@
 	    pjsua_perror(THIS_FILE, "Error resolving with STUN", status);
 	    pj_sock_close(sock);
-	    goto on_return;
+	    return status;
 	}
 
@@ -698,5 +696,5 @@
 	    pjsua_perror(THIS_FILE, "Unable to resolve local host", status);
 	    pj_sock_close(sock);
-	    goto on_return;
+	    return status;
 	}
 
@@ -709,13 +707,9 @@
     *p_sock = sock;
 
-on_return:
-
-    PJSUA_UNLOCK();
-
     PJ_LOG(4,(THIS_FILE, "SIP UDP socket reachable at %s:%d",
 	      pj_inet_ntoa(p_pub_addr->sin_addr),
 	      (int)pj_ntohs(p_pub_addr->sin_port)));
 
-    return status;
+    return PJ_SUCCESS;
 }
 
@@ -750,5 +744,5 @@
 
 	pjsua_transport_config config;
-	pj_sock_t sock;
+	pj_sock_t sock = PJ_INVALID_SOCKET;
 	pj_sockaddr_in pub_addr;
 	pjsip_host_port addr_name;
@@ -798,5 +792,5 @@
     PJSUA_UNLOCK();
 
-    return PJ_SUCCESS;
+    return status;
 }
 
