projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1890e5d
)
Make sure malloc worked before accessing the mem in chan_modem.c (bug 2704)
author
James Golovich
<james@gnuinter.net>
Sat, 23 Oct 2004 06:03:29 +0000
(06:03 +0000)
committer
James Golovich
<james@gnuinter.net>
Sat, 23 Oct 2004 06:03:29 +0000
(06:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4054
65c4cc65
-6c06-0410-ace0-
fbb531ad65f3
channels/chan_modem.c
patch
|
blob
|
history
diff --git
a/channels/chan_modem.c
b/channels/chan_modem.c
index
677edd4
..
a911f41
100755
(executable)
--- 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);