[svn-commits] dvossel: branch 1.6.1 r228341 - in /branches/1.6.1: ./ main/astfd.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Nov 6 09:44:08 CST 2009


Author: dvossel
Date: Fri Nov  6 09:44:04 2009
New Revision: 228341

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=228341
Log:
Merged revisions 228339 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r228339 | dvossel | 2009-11-06 09:42:46 -0600 (Fri, 06 Nov 2009) | 12 lines
  
  Merged revisions 228338 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r228338 | dvossel | 2009-11-06 09:41:41 -0600 (Fri, 06 Nov 2009) | 5 lines
    
    fixes crash in astfd.c
    
    (closes issue #15981)
    Reported by: slavon
  ........
................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/main/astfd.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/main/astfd.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/main/astfd.c?view=diff&rev=228341&r1=228340&r2=228341
==============================================================================
--- branches/1.6.1/main/astfd.c (original)
+++ branches/1.6.1/main/astfd.c Fri Nov  6 09:44:04 2009
@@ -130,15 +130,16 @@
 #undef socket
 int __ast_fdleak_socket(int domain, int type, int protocol, const char *file, int line, const char *func)
 {
-	char sdomain[20], stype[20], *sproto;
+	char sdomain[20], stype[20], *sproto = NULL;
 	struct protoent *pe;
 	int res = socket(domain, type, protocol);
 	if (res < 0 || res > 1023) {
 		return res;
 	}
 
-	pe = getprotobynumber(protocol);
-	sproto = pe->p_name;
+	if ((pe = getprotobynumber(protocol))) {
+		sproto = pe->p_name;
+	}
 
 	if (domain == PF_UNIX) {
 		ast_copy_string(sdomain, "PF_UNIX", sizeof(sdomain));
@@ -162,7 +163,11 @@
 		snprintf(stype, sizeof(stype), "%d", type);
 	}
 
-	STORE_COMMON(res, "socket", "%s,%s,\"%s\"", sdomain, stype, sproto);
+	if (sproto) {
+		STORE_COMMON(res, "socket", "%s,%s,\"%s\"", sdomain, stype, sproto);
+	} else {
+		STORE_COMMON(res, "socket", "%s,%s,\"%d\"", sdomain, stype, protocol);
+	}
 	return res;
 }
 




More information about the svn-commits mailing list