summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-05-10 05:01:17 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-05-10 05:01:17 +0000
commit05009014ce4be0942d9e6caf9dee1313f8435b6d (patch)
tree1d84fea08343be0f2c615bfdad1b62754d28b201 /zaptel.c
parent835e0930954a020094f647ca4fed160e11ca111a (diff)
Only free gains if they were alloc'd
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@178 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/zaptel.c b/zaptel.c
index 141ca96..207fe94 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -2499,7 +2499,8 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
!memcmp(chans[i]->txgain, defgain, 256)) {
/* This is really just a normal gain, so
deallocate the memory and go back to defaults */
- kfree(chans[i]->rxgain);
+ if (chans[i]->gainalloc)
+ kfree(chans[i]->rxgain);
chans[i]->rxgain = defgain;
chans[i]->txgain = defgain;
chans[i]->gainalloc = 0;