summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-12-21 19:12:53 +0300
committerDmitry Kozlov <xeb@mail.ru>2010-12-21 19:12:53 +0300
commit1dfb91adffc315294a948f3cae24a87a3f3d0d89 (patch)
tree148306658f48571c76e0cf0c2d5620b704a8017c
parent24533babd9fe766461ac346d8fc879f3fe4bc60b (diff)
downloadaccel-ppp-1dfb91adffc315294a948f3cae24a87a3f3d0d89.tar.gz
accel-ppp-1dfb91adffc315294a948f3cae24a87a3f3d0d89.zip
ppp: don't free chan_buf/unit_buf if they are null
-rw-r--r--accel-pptpd/ppp/ppp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c
index 79c90a33..e37f658d 100644
--- a/accel-pptpd/ppp/ppp.c
+++ b/accel-pptpd/ppp/ppp.c
@@ -66,9 +66,10 @@ void __export ppp_init(struct ppp_t *ppp)
static void _free_ppp(struct ppp_t *ppp)
{
- _free(ppp->chan_buf);
- _free(ppp->unit_buf);
-
+ if (ppp->chan_buf)
+ free(ppp->chan_buf);
+ if (ppp->unit_buf)
+ _free(ppp->unit_buf);
if (ppp->username)
_free(ppp->username);
}