The strdup() can be failed and return NULL. Not to access wrong
memory, explictly check memory allocation failure.
Change-Id: I2917cf0cebd6488004b653c29137c0acbb56074e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
if (opt_table)
free(opt_table);
opt_table = strdup(optarg);
- if (opt_table)
+ if (opt_table) {
part_table = opt_table;
+ } else {
+ fprintf(stderr, "Out of memory\n");
+ ret = -1;
+ goto out;
+ }
} else {
fprintf(stderr,
"path should be specified with '-i'\n");