Am 13.06.2012 09:00, schrieb Heinz Graalfs:
> Alex, thanks for the comments,
> 
> On Tue, 2012-06-12 at 13:38 +0200, Alexander Graf wrote:
>> On 06/06/2012 02:05 PM, Jens Freimann wrote:
>>> +static SCLPDevice *sclpef_common_init(const char *name, size_t struct_size)
>>> +{
>>> +    SCLPDevice *sdev;
>>> +
>>> +    sdev = malloc(struct_size);
>>
>> g_malloc please. I suppose even g_malloc0?
>>
> OK, I will look into this

Careful: The equivalent of malloc() and a NULL check is g_try_malloc().
g_malloc() aborts on failure to allocate.

The line to draw is whether this only happens at startup or whether this
is called at runtime *and* you are willing to consequently handle the
possible NULL return in all callers.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

Reply via email to