From: Arran Cudbard-Bell Date: Tue, 19 Jul 2016 20:52:28 +0000 (-0400) Subject: Don't leak rest handles on connection errors‽ X-Git-Tag: release_3_0_12~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7412786d95ac2b39a19ee2f77a29981c9adb86b3;p=thirdparty%2Ffreeradius-server.git Don't leak rest handles on connection errors‽ --- diff --git a/src/modules/rlm_rest/rlm_rest.c b/src/modules/rlm_rest/rlm_rest.c index cc5bb5cf595..1a7803c6b99 100644 --- a/src/modules/rlm_rest/rlm_rest.c +++ b/src/modules/rlm_rest/rlm_rest.c @@ -279,14 +279,20 @@ static ssize_t rest_xlat(void *instance, REQUEST *request, ret = rest_request_config(instance, §ion, request, handle, section.method, section.body, uri, NULL, NULL); talloc_free(uri); - if (ret < 0) return -1; + if (ret < 0) { + slen = -1; + goto finish; + } /* * Send the CURL request, pre-parse headers, aggregate incoming * HTTP body data into a single contiguous buffer. */ ret = rest_request_perform(instance, §ion, request, handle); - if (ret < 0) return -1; + if (ret < 0) { + slen = -1; + goto finish; + } hcode = rest_get_handle_code(handle); switch (hcode) {