[Asterisk-cvs] asterisk/channels chan_modem.c,1.29,1.30

citats at lists.digium.com citats at lists.digium.com
Sat Oct 23 01:59:30 CDT 2004


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

Modified Files:
	chan_modem.c 
Log Message:
Make sure malloc worked before accessing the mem in chan_modem.c (bug 2704)

Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- chan_modem.c	3 Oct 2004 04:19:58 -0000	1.29
+++ chan_modem.c	23 Oct 2004 06:03:29 -0000	1.30
@@ -712,8 +712,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