axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Mengué (JIRA) <j...@apache.org>
Subject [jira] Created: (AXIS2C-1461) axutil_allocator_init(): unsafe memset() call
Date Thu, 04 Mar 2010 16:27:27 GMT
axutil_allocator_init(): unsafe memset() call
---------------------------------------------

                 Key: AXIS2C-1461
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1461
             Project: Axis2-C
          Issue Type: Bug
          Components: util
    Affects Versions: 1.6.0, Current (Nightly)
            Reporter: Olivier Mengué


In axutil_allocator_init(), memset() is called before checking if the malloc() call succeed.


36   AXIS2_EXTERN axutil_allocator_t *AXIS2_CALL
37 	axutil_allocator_init(
38 	axutil_allocator_t * allocator)
39 	{
40 	if(allocator)
41 	return allocator;
42 	
43 	else
44 	{
45 	allocator = (axutil_allocator_t *)malloc(sizeof(axutil_allocator_t));
46 	memset(allocator, 0, sizeof(axutil_allocator_t));
47 	if(allocator)
48 	{
49 	allocator->malloc_fn = axutil_allocator_malloc_impl;
50 	allocator->realloc = axutil_allocator_realloc_impl;
51 	allocator->free_fn = axutil_allocator_free_impl;
52 	allocator->global_pool_ref = 0;
53 	
54 	return allocator;
55 	}
56 	}
57 	return NULL;
58 	} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org


Mime
View raw message