]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix double free in rlm_sql acct_redundant 2180/head
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Tue, 13 Feb 2018 14:56:10 +0000 (16:56 +0200)
committerNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Tue, 13 Feb 2018 14:56:10 +0000 (16:56 +0200)
Do not free "expanded" buffer twice in "acct_redundant" in rlm_sql.c.
This fixes a crash in the case of an accounting packet not matching a
Start entry in the database.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1540580

Found and fixed by Benoit Welterlen.

src/modules/rlm_sql/rlm_sql.c

index 3bf9be2fc393788f0a22b104410af0523d5bba25..1b8f826ad1f8eeb4505087172ee7d22bbfa52c4b 100644 (file)
@@ -1439,7 +1439,6 @@ static int acct_redundant(rlm_sql_t *inst, REQUEST *request, sql_acct_section_t
                if (!*expanded) {
                        RDEBUG("Ignoring null query");
                        rcode = RLM_MODULE_NOOP;
-                       talloc_free(expanded);
 
                        goto finish;
                }