fix: malloc error handling
1 files changed, 3 insertions(+), 0 deletions(-) M file-browser/src/path.c
M file-browser/src/path.c => file-browser/src/path.c +3 -0
@@ 17,6 17,9 @@ char *path_join(char *base, char *relative) { size_t new_len = base_len + relative_len + 1; // length of the string char *out = malloc((new_len + 1) * sizeof(out)); // length of the string plus one for \0 + if (out == NULL) { + return NULL; + } out[new_len] = '\0'; out[base_len] = '/';