projects
/
sdk
/
tools
/
profctl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbe4db7
)
Check malloc result
author
Igor Kulaychuk
<i.kulaychuk@samsung.com>
Thu, 13 Dec 2018 12:01:18 +0000
(15:01 +0300)
committer
Igor Kulaychuk
<i.kulaychuk@samsung.com>
Thu, 13 Dec 2018 12:23:39 +0000
(15:23 +0300)
proc_stat.c
patch
|
blob
|
history
diff --git
a/proc_stat.c
b/proc_stat.c
index 1fc53f2b8c6c24c64fb46d75e8c8e719624cbdcb..ead44a15a809676a8785e8e3f01c7bfbc930a36a 100644
(file)
--- a/
proc_stat.c
+++ b/
proc_stat.c
@@
-311,6
+311,9
@@
pthread_t start_write_proc_stat(FILE *output, int pid, int timeout_usec, int ver
}
struct outstat_info *oi = malloc(sizeof(struct outstat_info));
+ if (oi == NULL) {
+ log_system_error_and_exit("malloc(sizeof(struct outstat_info))");
+ }
oi->file = output;
oi->pid = pid;
oi->timeout_usec = timeout_usec;