From: Dmitry V. Levin Date: Sat, 19 Apr 2008 14:12:49 +0000 (+0000) Subject: 2008-04-19 Dmitry V. Levin X-Git-Tag: v4.5.18~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a97f03b781904bbb1af35d9610cec88930359096;p=strace 2008-04-19 Dmitry V. Levin * count.c (call_summary_pers): Check calloc() return value. Signed-off-by: "Yang Zhiguo" --- diff --git a/ChangeLog b/ChangeLog index ddde8c27..2150a45e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-19 Dmitry V. Levin + + * count.c (call_summary_pers): Check calloc() return value. + Signed-off-by: "Yang Zhiguo" + 2008-03-26 Roland McGrath * strace.spec (strace64_arches): Add sparc64. diff --git a/count.c b/count.c index 493fea15..4e272a36 100644 --- a/count.c +++ b/count.c @@ -164,9 +164,14 @@ call_summary_pers(FILE *outf) double percent; char *dashes = "-------------------------"; char error_str[16]; - int *sorted_count = calloc(sizeof(int), nsyscalls); + if (!sorted_count) + { + fprintf(stderr, "strace: out of memory for call summary\n"); + return; + } + call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0; if (overhead.tv_sec == -1) {