3 ms·
strdup(), part of the libc, allocates memory with a function from the libc (malloc), therefore you are allocating and freeing memory with functions within the s
by shin_lao 14y ago
strdup(), part of the libc, allocates memory with a function from the libc (malloc), therefore you are allocating and freeing memory with functions within the same library.
However, yes, for security reasons strdup should be avoided.