]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM DB: Fix a memory leak on DB connection re-opening
authorJouni Malinen <j@w1.fi>
Sun, 19 Aug 2012 18:17:26 +0000 (21:17 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Aug 2012 18:17:26 +0000 (21:17 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_server/eap_sim_db.c

index 611e89b344be53b73182a1f030b4e69b05b663e0..68fb1f0a63dff88ea81c3f0050ac7fb27dbd40cf 100644 (file)
@@ -340,6 +340,7 @@ static int eap_sim_db_open_socket(struct eap_sim_db_data *data)
        addr.sun_family = AF_UNIX;
        os_snprintf(addr.sun_path, sizeof(addr.sun_path),
                    "/tmp/eap_sim_db_%d-%d", getpid(), counter++);
+       os_free(data->local_sock);
        data->local_sock = os_strdup(addr.sun_path);
        if (bind(data->sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
                perror("bind(eap_sim_db)");