[Asterisk-cvs] asterisk/channels chan_modem.c,1.27,1.27.2.1

russell at lists.digium.com russell at lists.digium.com
Sun Oct 24 17:06:02 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv21529/channels

Modified Files:
      Tag: v1-0
	chan_modem.c 
Log Message:
make sure malloc was successful before doing memset (bug #2704)


Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -u -d -r1.27 -r1.27.2.1
--- chan_modem.c	27 Aug 2004 16:17:16 -0000	1.27
+++ chan_modem.c	24 Oct 2004 21:09:40 -0000	1.27.2.1
@@ -707,8 +707,8 @@
 #endif
 	
 	tmp = malloc(sizeof(struct ast_modem_pvt));
-	memset(tmp, 0, sizeof(struct ast_modem_pvt));
 	if (tmp) {
+		memset(tmp, 0, sizeof(struct ast_modem_pvt));
 		tmp->fd = open(iface, O_RDWR | O_NONBLOCK);
 		if (tmp->fd < 0) {
 			ast_log(LOG_WARNING, "Unable to open '%s'\n", iface);




More information about the svn-commits mailing list