Rev 687: fixed an error handling condition in the dmapi code in http://samba.org/~tridge/3_0-ctdb

tridge at samba.org tridge at samba.org
Thu Jan 17 02:52:03 GMT 2008


------------------------------------------------------------
revno: 687
revision-id:tridge at samba.org-20080117025201-1f8b5848nh2f6n0q
parent: tridge at samba.org-20080115023113-vli7oc3sc5gnsy08
committer: Andrew Tridgell <tridge at samba.org>
branch nick: s3-ctdb-tridge
timestamp: Thu 2008-01-17 13:52:01 +1100
message:
  fixed an error handling condition in the dmapi code
modified:
  source/smbd/dmapi.c            dmapi.c-20070210173807-1wjifrbwaz6xnmgl-1002
=== modified file 'source/smbd/dmapi.c'
--- a/source/smbd/dmapi.c	2007-08-27 02:51:20 +0000
+++ b/source/smbd/dmapi.c	2008-01-17 02:52:01 +0000
@@ -228,7 +228,7 @@
 	if (dmapi_have_session() && !attached) {
 		attached++;
 		if (reattach_dmapi_session() < 0) {
-			return DM_NO_SESSION;
+			return NULL;
 		}
 	}
 	return &samba_dmapi_session;
@@ -240,13 +240,17 @@
 	int		err;
 	dm_eventset_t   events = {0};
 	uint		nevents;
-
+	void *session_ptr;
 	void	*dm_handle;
 	size_t	dm_handle_len;
-
 	uint32	flags = 0;
 
-	dmapi_session = *(dm_sessid_t*) dmapi_get_current_session();
+	session_ptr = dmapi_get_current_session();
+	if (session_ptr == NULL) {
+		return 0;
+	}
+
+	dmapi_session = *(dm_sessid_t*)session_ptr;
 	if (dmapi_session == DM_NO_SESSION) {
 		return 0;
 	}



More information about the samba-cvs mailing list