summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/conn.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index 1dc4ac9e7d..f43a30d320 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -164,15 +164,13 @@ free a conn structure
****************************************************************************/
void conn_free(connection_struct *conn)
{
- /* Close dlopen() handle */
-
- if (conn->vfs_conn->dl_handle != NULL) {
- dlclose(conn->vfs_conn->dl_handle); /* should we check return val? */
- }
-
/* Free vfs_connection_struct */
if (conn->vfs_conn != NULL) {
+ /* Close dlopen() handle */
+ if (conn->vfs_conn->dl_handle) {
+ dlclose(conn->vfs_conn->dl_handle);
+ }
if (conn->vfs_conn->groups != NULL) {
free(conn->vfs_conn->groups);
}