From 0e178517ce6df2e33f529cc5a20c73eb4f9c7657 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 12 Apr 2010 17:33:44 -0700 Subject: [PATCH] Fix file descriptor leakage when closing PPP recording --- gatchat/gatppp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index b98ab14d..259fdeb0 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -536,8 +536,10 @@ void g_at_ppp_set_recording(GAtPPP *ppp, const char *filename) if (ppp == NULL) return; - if (ppp->record_fd > fileno(stderr)) + if (ppp->record_fd > fileno(stderr)) { close(ppp->record_fd); + ppp->record_fd = -1; + } if (filename == NULL) return;