[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leak in dir-lookup found

From: Neal H Walfield
Subject: Re: memory leak in dir-lookup found
Date: Thu, 12 Apr 2001 16:45:50 +0200
User-agent: Mutt/1.3.15i

> I don't think this is a useful interface change.  To my mind, your
> interface makes it easier to fail to check for errors and more dangerous to
> do so.  That is, you can just ignore the error_t return value and an
> undetected error results in an uninitialized result parameter that the
> careless code will then try to use with unpredictable results.  Conversely,
> with the interface that returns the pointer, a caller will never ignore the
> return value (because that's the only point of calling the function); a
> careless caller will then dereference a null pointer, which will crash
> quickly and clearly at that spot.  When the only possible reason for
> failure is ENOMEM, there is no benefit in returning an error code.

Would you accept this change:  same functions except, they return a
struct iouser *?  E.g.

struct iouser *iohelp_create_simple_iouser (uid_t uid, gid_t gid);


Attachment: pgpjZlD5X7XOV.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]