Sujet : Re: avoiding strdup()
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 29. Apr 2024, 01:53:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v0mr1e$1bfnq$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Sun, 10 Mar 2024 18:47:42 GMT, Scott Lurndal wrote:
I've seen a lot of open source code
that uses strdup without checking for failure and frequently
"forgetting" to free the result.
I was looking at the systemd source code the other day, and came across a
lot of this sort of thing:
_cleanup_free_ char *link = NULL;
Now, what do you suppose “_cleanup_free_” does?