summaryrefslogtreecommitdiff
path: root/src/crash-manager/crash-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crash-manager/crash-manager.c')
-rw-r--r--src/crash-manager/crash-manager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c
index 419e16a..0a2bc23 100644
--- a/src/crash-manager/crash-manager.c
+++ b/src/crash-manager/crash-manager.c
@@ -235,7 +235,7 @@ static int prepare_paths(void)
_E("Couldn't allocate memory for crash_crash_path: %m\n");
return 0;
}
- snprintf(crash_crash_path, tmp_len, "%s%s", crash_root_path, CRASH_PATH_SUBDIR);
+ snprintf(crash_crash_path, tmp_len + 1, "%s%s", crash_root_path, CRASH_PATH_SUBDIR);
tmp_len = strlen(crash_root_path) + strlen(CRASH_TEMP_SUBDIR);
crash_temp_path = (char*)malloc(tmp_len + 1);
@@ -243,7 +243,7 @@ static int prepare_paths(void)
_E("Couldn't allocate memory for crash_temp_path: %m\n");
return 0;
}
- snprintf(crash_temp_path, tmp_len, "%s%s", crash_root_path, CRASH_TEMP_SUBDIR);
+ snprintf(crash_temp_path, tmp_len + 1, "%s%s", crash_root_path, CRASH_TEMP_SUBDIR);
return 1;
}
@@ -682,6 +682,8 @@ exit:
g_variant_unref(reply);
if (parameters)
g_variant_unref(parameters);
+
+ g_object_unref(conn);
}
static int dump_system_state(const struct crash_info *cinfo)