diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2014-08-19 15:12:10 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-08-19 15:25:57 +0400 |
commit | 92664c52200ef078cdabfd05ae1c0f8175c21bb5 (patch) | |
tree | 8d2be15a5cd0dd2562cacf69b49cad931dd719aa | |
parent | 8197bae072f537f21a965b29bfd5fabb1875677e (diff) |
signals: Don't forget to allocate SiginfoEntry
The se variable is just an array of pointers on these
objects. Need to allocate the objects themselves.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | cr-dump.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -1202,10 +1202,23 @@ static int dump_signal_queue(pid_t tid, SignalQueueEntry **sqe, bool group) } for (j = queue->n_signals - nr; j < queue->n_signals; j++) { - queue->signals[j]->siginfo.len = sizeof(siginfo_t); - queue->signals[j]->siginfo.data = (void *) (siginfo + j); + SiginfoEntry *se; + + se = xmalloc(sizeof(*se)); + if (!se) { + ret = -1; + break; + } + + siginfo_entry__init(se); + se->siginfo.len = sizeof(siginfo_t); + se->siginfo.data = (void *) (siginfo + j); + queue->signals[j] = se; } + if (ret < 0) + break; + arg.off += nr; } |