summaryrefslogtreecommitdiffstats
path: root/src/Backtrace/backtrace.c
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-11-30 16:42:58 +0100
committerKarel Klic <kklic@redhat.com>2009-11-30 16:42:58 +0100
commit277c2b79dd8d4bfa9eac979bcb51dc050ff1627b (patch)
treebd0f27e13150f9ec427ee1e78b4967e9de7b607c /src/Backtrace/backtrace.c
parent3b97c373a8d6bce4fa8b8ae5f014f83dab39d09a (diff)
downloadabrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.tar.gz
abrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.tar.xz
abrt-277c2b79dd8d4bfa9eac979bcb51dc050ff1627b.zip
Added -Wall CFLAG and fixed all warnings.
Diffstat (limited to 'src/Backtrace/backtrace.c')
-rw-r--r--src/Backtrace/backtrace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Backtrace/backtrace.c b/src/Backtrace/backtrace.c
index 5e2d4bbd..5a112732 100644
--- a/src/Backtrace/backtrace.c
+++ b/src/Backtrace/backtrace.c
@@ -97,6 +97,7 @@ struct thread *thread_new()
t->number = 0;
t->frames = NULL;
t->next = NULL;
+ return t;
}
void thread_free(struct thread *t)
@@ -214,6 +215,7 @@ struct backtrace *backtrace_new()
bt->threads = NULL;
bt->crash = NULL;
+ return bt;
}
void backtrace_free(struct backtrace *bt)
@@ -363,7 +365,7 @@ void backtrace_limit_frame_depth(struct backtrace *backtrace, int depth)
/* Skip some frames to get the required stack depth. */
int i = depth;
- struct frame *last_frame;
+ struct frame *last_frame = NULL;
while (frame && i)
{
last_frame = frame;
@@ -372,7 +374,9 @@ void backtrace_limit_frame_depth(struct backtrace *backtrace, int depth)
}
/* Delete the remaining frames. */
- last_frame->next = NULL;
+ if (last_frame)
+ last_frame->next = NULL;
+
while (frame)
{
struct frame *rm = frame;