diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-05-10 05:01:17 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-05-10 05:01:17 +0000 |
commit | 05009014ce4be0942d9e6caf9dee1313f8435b6d (patch) | |
tree | 1d84fea08343be0f2c615bfdad1b62754d28b201 /zaptel.c | |
parent | 835e0930954a020094f647ca4fed160e11ca111a (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-x | zaptel.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |