diff options
Diffstat (limited to 'core/profile.c')
-rw-r--r-- | core/profile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/profile.c b/core/profile.c index 109ec4508..efcfe45a4 100644 --- a/core/profile.c +++ b/core/profile.c @@ -844,6 +844,10 @@ static void setup_gas_sensor_pressure(const struct dive *dive, const struct dive { int prev, i; const struct event *ev; + + if (pi->nr_cylinders == 0) + return; + int *seen = malloc(pi->nr_cylinders * sizeof(*seen)); int *first = malloc(pi->nr_cylinders * sizeof(*first)); int *last = malloc(pi->nr_cylinders * sizeof(*last)); |