Skip to content
Permalink
Browse files

Checking return value of strdup() in collect_full_irq_list()

strdup() may return NULL if memory allocation fail, checking the return
value before reference.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
  • Loading branch information...
yeyunfeng-dev committed Sep 22, 2019
1 parent 88af3aa commit 7265665307ab991d0aa452e0b4590b3c1072d0a0
Showing with 2 additions and 0 deletions.
  1. +2 −0 procinterrupts.c
@@ -189,6 +189,8 @@ GList* collect_full_irq_list()
continue;

savedline = strdup(line);
if (!savedline)
break;
irq_name = strtok_r(savedline, " ", &savedptr);
if (strstr(irq_name, "xen-dyn") != NULL)
is_xen_dyn = 1;

0 comments on commit 7265665

Please sign in to comment.
You can’t perform that action at this time.