From 8edaaaf2100ef951953e3c282f70e56c5e439b70 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sat, 21 Jun 2014 11:54:26 -0500 Subject: [PATCH] gatchat: Fix up minor coding style issues --- gatchat/gatppp.c | 2 ++ gatchat/ppp_auth.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index e3266ef..5144084 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -231,6 +231,7 @@ static void ppp_receive(const unsigned char *buf, gsize len, void *data) ppp_pap_process_packet(ppp->pap, packet, len - offset); else pppcp_send_protocol_reject(ppp->lcp, buf, len); + break; case CHAP_PROTOCOL: if (ppp->chap) { @@ -464,6 +465,7 @@ void ppp_lcp_up_notify(GAtPPP *ppp) else /* It'll never work out. */ ppp_auth_notify(ppp, FALSE); + return; } diff --git a/gatchat/ppp_auth.c b/gatchat/ppp_auth.c index 84cd861..feeeaaa 100644 --- a/gatchat/ppp_auth.c +++ b/gatchat/ppp_auth.c @@ -258,9 +258,11 @@ gboolean ppp_pap_start(struct ppp_pap *pap) guint16 length; length = sizeof(*authreq) + strlen(username) + strlen(password) + 2; + packet = ppp_packet_new(length, PAP_PROTOCOL); if (packet == NULL) return FALSE; + pap->authreq = packet; pap->authreq_len = length; @@ -279,7 +281,7 @@ gboolean ppp_pap_start(struct ppp_pap *pap) ppp_transmit(pap->ppp, (guint8 *)packet, length); pap->retries = 0; pap->retry_timer = g_timeout_add_seconds(PAP_TIMEOUT, - ppp_pap_timeout, pap); + ppp_pap_timeout, pap); return TRUE; } @@ -288,8 +290,10 @@ void ppp_pap_free(struct ppp_pap *pap) { if (pap->retry_timer != 0) g_source_remove(pap->retry_timer); + if (pap->authreq != NULL) g_free(pap->authreq); + g_free(pap); } -- 2.7.4