Avoid memory leak when sending RADIUS accounting start message failed
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 15:43:02 +0000 (17:43 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 28 Sep 2012 15:43:02 +0000 (17:43 +0200)
src/libcharon/plugins/eap_radius/eap_radius_accounting.c

index 2d9a755..f164f67 100644 (file)
@@ -207,9 +207,9 @@ static void send_start(private_eap_radius_accounting_t *this, ike_sa_t *ike_sa)
                this->mutex->lock(this->mutex);
                entry = this->sessions->put(this->sessions, (void*)(uintptr_t)id, entry);
                this->mutex->unlock(this->mutex);
                this->mutex->lock(this->mutex);
                entry = this->sessions->put(this->sessions, (void*)(uintptr_t)id, entry);
                this->mutex->unlock(this->mutex);
-               free(entry);
        }
        message->destroy(message);
        }
        message->destroy(message);
+       free(entry);
 }
 
 /**
 }
 
 /**