[PATCH 4/6] added openconnect_strdup()

David Woodhouse dwmw2 at infradead.org
Tue Aug 26 06:02:28 PDT 2014


On Tue, 2014-08-26 at 14:57 +0200, Nikos Mavrogiannopoulos wrote:
> Isn't the current openconnect_strdup() process simpler? Only on
> function is exported, and it is straightforward to use.

I'm not sure about "simpler"; it's a question of *where* we put the
simplicity, and where we put the burden.

The openconnect_strdup() approach puts the burden on the caller to
remember to do it for all strings which are passed in to libopenconnect.
Callers are likely to forget and that leads to hard-to-diagnose bugs.

On the other hand, if we do a single run through all the entry points,
mostly in library.c, which take strings from outside the application
that's mostly a one-off and should isolate us from that class of bug for
ever more. 

-- 
dwmw2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20140826/5be989a7/attachment-0001.bin>


More information about the openconnect-devel mailing list