aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-12-06 10:30:36 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-06 11:00:52 -0800
commit5ac5408bb0775b7126242ec614b48b14cbdf3ab9 (patch)
tree9a3d4e985202079b744164afa6d2e012749a1a56 /dive.c
parentd5da3c9a958de044ad934290d72ee9e1213fa427 (diff)
downloadsubsurface-5ac5408bb0775b7126242ec614b48b14cbdf3ab9.tar.gz
Fix SIGSEGV when joining dives without dive computer information
Handle the case where we have no divecomputer information. Reported-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index f527fae37..9e44345cf 100644
--- a/dive.c
+++ b/dive.c
@@ -1292,7 +1292,7 @@ static void interleave_dive_computers(struct divecomputer *res,
do {
struct divecomputer *match;
- res->model = strdup(a->model);
+ res->model = a->model ? strdup(a->model) : NULL;
res->deviceid = a->deviceid;
res->diveid = a->diveid;
res->next = NULL;