diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-07-22 18:48:30 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-22 18:48:30 +0200 |
commit | e9e41c02d4309cd50b5584a8dfc0d7e01cb27e10 (patch) | |
tree | 365b00dba760153e8d88fa143fb7e15a2a1a6448 /src/main.c | |
parent | 93db3b8726f6d7574b71926285e86135e822f9d3 (diff) |
Kill child process when parent dies
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1,5 +1,4 @@ #include "../include/parser.h" -#include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -38,6 +37,7 @@ static char* file_get_content(const char *filepath, size_t *filesize) { result[*filesize] = '\0'; if((size_t)read(fd, result, *filesize) != *filesize) { free(result); + result = NULL; *filesize = 0; fprintf(stderr, "Error: Failed to read all data from file %s\n", filepath); goto cleanup; |