harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r574353 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
Date Mon, 10 Sep 2007 20:02:38 GMT
Author: hindessm
Date: Mon Sep 10 13:02:38 2007
New Revision: 574353

URL: http://svn.apache.org/viewvc?rev=574353&view=rev
Log:
Don't do a second malloc if the first fails.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?rev=574353&r1=574352&r2=574353&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
Mon Sep 10 13:02:38 2007
@@ -94,10 +94,14 @@
   }
 
   send_buf = (struct icmp*)malloc(sizeof(char)*ICMP_SIZE);
+  if (NULL == send_buf) {
+    ret = NOPRIVILEGE;
+    goto cleanup;
+  }
   recv_buf = (struct ip*)malloc(sizeof(char)*PACKET_SIZE);
-  if (NULL == send_buf || NULL == recv_buf){
-	  ret = NOPRIVILEGE;
-      goto cleanup;
+  if (NULL == recv_buf) {
+    ret = NOPRIVILEGE;
+    goto cleanup;
   }
   set_icmp_packet(send_buf, ICMP_SIZE);
 



Mime
View raw message