Fix for bug 774. Check malloc return before accessing pointer.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@775 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Mark Haverkamp 2005-07-26 22:47:27 +00:00
parent cfbd699177
commit 4dd48bef0d

View File

@ -1850,14 +1850,14 @@ saEvtEventPublish(
req = malloc(sizeof(*req) + eventDataSize + pattern_size);
patterns = (struct event_pattern *)req->led_body;
data_start = (void *)req->led_body + pattern_size;
if (!req) {
error = SA_AIS_ERR_NO_MEMORY;
goto pub_put3;
}
patterns = (struct event_pattern *)req->led_body;
data_start = (void *)req->led_body + pattern_size;
/*
* copy everything to the request structure
*/