NNG_STRFREE(3)
β¨ NAME β¨
nng_strfree β free memory, bestie π (like the manual says: "free memory")
Okay so this is from the NNG Reference Manual, page NNG_STRFREE(3), and it's literally just one tiny little function that does one tiny little job. Slay.
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
void nng_strfree(char *str);
That's it. That's the whole vibe. π«Ά
π DESCRIPTION π
So the nng_strfree() function deallocates the string str. Freeing it. Releasing it. Sending it back to the void. π¦
Here's the tea though β it's equivalent to calling nng_free() with the length of str plus one as the size (that extra one is for the NUL terminating byte, you have to count the terminator, no cap).
β οΈ Important: This should only be used with strings that were allocated bynng_strdup()ornng_alloc(). In all cases, the allocation size of the string must be the same asstrlen(str) + 1. Periodt.
β οΈ Important (yes, a second one, it's serious): Consequently, if the string created withnng_strdup()is modified to be shorter, then it is incorrect to call this function. π (Thenng_free()function can be used instead in that case, using the length of the original string plus one for the size.)
The way that shrinking a string quietly breaks this... π read the warnings, i'm begging.
β RETURN VALUES β
None. Nothing. Zero. She gives you nothing back and honestly? Iconic. π
π ERRORS π
None. Can't error if you don't have anything to report, iykyk. β¨
π SEE ALSO π
Okay that's the whole page bestie, you're so welcome π This was the NNG Reference Manual, page NNG_STRFREE(3), dated 2026-06-30 β go free your strings responsibly, mwah ππΈπ§
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms