summaryrefslogtreecommitdiff
path: root/source3/lib/messages.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r--source3/lib/messages.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 78cd3e22bc..54f6321041 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -322,12 +322,19 @@ void message_register(int msg_type,
dfn = (struct dispatch_fns *)malloc(sizeof(*dfn));
- ZERO_STRUCTP(dfn);
+ if (dfn != NULL) {
- dfn->msg_type = msg_type;
- dfn->fn = fn;
+ ZERO_STRUCTPN(dfn);
- DLIST_ADD(dispatch_fns, dfn);
+ dfn->msg_type = msg_type;
+ dfn->fn = fn;
+
+ DLIST_ADD(dispatch_fns, dfn);
+ }
+ else {
+
+ DEBUG(0,("message_register: Not enough memory. malloc failed!\n"));
+ }
}
/****************************************************************************