projects
/
platform
/
core
/
system
/
initrd-flash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7062cae
)
fix use string after null check
77/222177/1
accepted/tizen/unified/20200113.130531
submit/tizen/20200113.015142
author
Seung-Woo Kim
<sw0312.kim@samsung.com>
Fri, 10 Jan 2020 06:29:42 +0000
(15:29 +0900)
committer
Seung-Woo Kim
<sw0312.kim@samsung.com>
Fri, 10 Jan 2020 06:29:47 +0000
(15:29 +0900)
The result of strdup() can be null, so use it after null check.
Change-Id: I61b5e5a4d4b631984eb19240b46afe0e94752043
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index
194e2c8
..
80267db
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-39,7
+39,8
@@
int _main(int argc, char *argv[])
if (opt_table)
free(opt_table);
opt_table = strdup(optarg);
- part_table = opt_table;
+ if (opt_table)
+ part_table = opt_table;
} else {
fprintf(stderr,
"path should be specified with '-i'\n");