free memory on error
authoraland <aland>
Fri, 28 Dec 2007 21:02:14 +0000 (21:02 +0000)
committeraland <aland>
Fri, 28 Dec 2007 21:02:14 +0000 (21:02 +0000)
src/modules/rlm_sql/sql.c

index f3319bf..41a0b19 100644 (file)
@@ -104,6 +104,7 @@ int sql_init_socketpool(SQL_INST * inst)
 #ifdef HAVE_PTHREAD_H
                rcode = pthread_mutex_init(&sqlsocket->mutex,NULL);
                if (rcode != 0) {
+                       free(sqlsocket);
                        radlog(L_ERR, "rlm_sql: Failed to init lock: %s",
                               strerror(errno));
                        return 0;