Make sure malloc worked before accessing the mem in tdd.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
James Golovich
2004-10-23 06:28:19 +00:00
parent 10dfeecffe
commit 584418a282

2
tdd.c
View File

@@ -77,8 +77,8 @@ struct tdd_state *tdd_new(void)
{
struct tdd_state *tdd;
tdd = malloc(sizeof(struct tdd_state));
memset(tdd, 0, sizeof(struct tdd_state));
if (tdd) {
memset(tdd, 0, sizeof(struct tdd_state));
tdd->fskd.spb = 176; /* 45.5 baud */
tdd->fskd.hdlc = 0; /* Async */
tdd->fskd.nbit = 5; /* 5 bits */