kfree_strarray(9)
β¨ kfree_strarray β the kernel API manual, bestie edition β¨
okay so you're in the Kernel API Manual and the function we're talking about is kfree_strarray(9). yes that's the title, yes I'm telling you up front, we're doing this properly π
πΈ NAME πΈ
kfree_strarray β frees a number of dynamically allocated strings that are chilling inside an array, plus the array itself. like, the whole thing goes π«Ά
π¦ SYNOPSIS π¦
void kfree_strarray (char **array , size_t n );
π ARGUMENTS π
arrayβ the dynamically allocated array of strings you want to free. it's achar **, it's living its best life on the heap, and now it's gotta go β¨nβ the number of strings to free, counting from the beginning of the array. so like, the first n ones, in order, no skipping π
π DESCRIPTION π
okay so there are two very valid use-cases here and I need you to not panic about either of them:
- passing a non-NULL
arraytogether withn == 0β totally valid, no notes π - passing a
NULLarrayβ also valid, also fine, we love a flexible API
and if array is NULL? the function literally does nothing. that's it. that's the whole vibe check. nothing happens, no crash, no drama, we simply move on π§
π₯ SEE ALSO π₯
- Kernel file
./lib/string_helpers.c string_get_size(9)parse_int_array_user(9)string_unescape(9)string_escape_mem(9)kasprintf_strarray(9)skip_spaces(9)strim(9)sysfs_streq(9)match_string(9)__sysfs_match_string(9)strreplace(9)memcpy_and_pad(9)
ngl if you got here, you're giving kernel dev main character energy π go read the whole string_helpers.c bestie, iykyk
and that's the page!! π this little icon comes from ./lib, dated October 2026, and it's filed under kfree_strarray(9) β mwah, periodt ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms