------------------------------------------------------------
revno: 687
revision-id:[EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
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;
}