From f94983728ebaf1a6272e4f47977d09236cdd25c3 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 18 Jul 2009 00:28:27 +0200 Subject: direct-append: Check return value of malloc --- direct-append.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct-append.c b/direct-append.c index af7efb4..2b782ff 100644 --- a/direct-append.c +++ b/direct-append.c @@ -61,6 +61,10 @@ int main(int argc, char *argv[]) } str = malloc(n_chars * sizeof(char)); + if (!str) { + perror("malloc"); + exit(EXIT_FAILURE); + } for (i = 0; i < n_chars; i++) str[i] = get_random_printable_char(); -- cgit v1.2.3-54-g00ecf i/linux/net-next.git' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines