summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunmin Lee <sunm.lee@samsung.com>2017-09-28 19:05:07 +0900
committerSunmin Lee <sunm.lee@samsung.com>2017-09-28 19:05:07 +0900
commitf4864db8e8abf3fe373f7d676b21af9e8123cf2a (patch)
tree5eb9cef5bd42fc7ebededd5d22130c88ea5e1f2c
parentb4bb8d3551ba1c19a4f802758088734c257caaa0 (diff)
downloadcrash-worker-f4864db8e8abf3fe373f7d676b21af9e8123cf2a.tar.gz
crash-worker-f4864db8e8abf3fe373f7d676b21af9e8123cf2a.tar.bz2
crash-worker-f4864db8e8abf3fe373f7d676b21af9e8123cf2a.zip
Change-Id: I9c5c08eb424f5e9bdab248682b00e9cb895c7afa Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
-rw-r--r--src/crash-manager/crash-manager.c4
-rw-r--r--src/dump_systemstate/dump_systemstate.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c
index 1d91d3a..1520441 100644
--- a/src/crash-manager/crash-manager.c
+++ b/src/crash-manager/crash-manager.c
@@ -244,7 +244,7 @@ error:
static int set_crash_info(int argc, char *argv[])
{
int ret;
- char *temp_dir_ret;
+ char *temp_dir_ret = NULL;
time_t time_val;
struct tm loc_tm;
@@ -271,7 +271,7 @@ static int set_crash_info(int argc, char *argv[])
return -1;
}
temp_dir_ret = mkdtemp(crash_info.temp_dir);
- if (access(temp_dir_ret, F_OK)) {
+ if (!temp_dir_ret || access(temp_dir_ret, F_OK)) {
_E("Failed to mkdtemp for temp_dir");
return -1;
}
diff --git a/src/dump_systemstate/dump_systemstate.c b/src/dump_systemstate/dump_systemstate.c
index 673ca9a..2c1303c 100644
--- a/src/dump_systemstate/dump_systemstate.c
+++ b/src/dump_systemstate/dump_systemstate.c
@@ -101,8 +101,9 @@ int main(int argc, char *argv[])
case 'f':
arg_file = optarg;
break;
- case '?': printf("\n");
+ case '?':
case 'h':
+ printf("\n");
usage();
ret = 0;
goto exit;