aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_modem.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-23 06:03:29 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-23 06:03:29 +0000
commita3d59ebeb28aba9d4a9bf6ba518008fecded969f (patch)
tree2bb748b857821e2215b8dba8d4fdf3bf4786b92e /channels/chan_modem.c
parente074114c01987036f411dcf8ef9557eebad9d061 (diff)
Make sure malloc worked before accessing the mem in chan_modem.c (bug 2704)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4054 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_modem.c')
-rwxr-xr-xchannels/chan_modem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_modem.c b/channels/chan_modem.c
index 677edd4fb..a911f41e1 100755
--- a/channels/chan_modem.c
+++ b/channels/chan_modem.c
@@ -712,8 +712,8 @@ static struct ast_modem_pvt *mkif(char *iface)
#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);