[Eug-lug] LP64
Bob Miller
kbob at jogger-egg.com
Mon Jan 10 16:38:11 PST 2005
Jacob Meuser wrote:
> the thing is, there's also a foo_open function, that returns a
> pointer to a struct. the code was apparently written to make
> open and ibp_open interchangable. since they have different
> return types, the author chose to use (void *). the only use
> of data is "if(!data) { ... }".
And that's wrong too. Zero is a valid file descriptor, but not
a valid pointer. Never mind that if you never pass the descriptor
to close(), you have a descriptor leak.
--
Bob Miller K<bob>
kbobsoft software consulting
http://kbobsoft.com kbob at jogger-egg.com
More information about the EUGLUG
mailing list