diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-14 13:33:12 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-14 13:45:54 -0800 |
commit | 8d766e13e258e206edb2c2746895845de942fa8e (patch) | |
tree | 435f3287c34cd20e3da037940dd5349f45861c56 /equipment.c | |
parent | 1055b5afd35526c552eafcaf26d5f1d9aac43c86 (diff) | |
download | subsurface-8d766e13e258e206edb2c2746895845de942fa8e.tar.gz |
Make sure we always have copies of equipment descriptions
Having pointers copied around that might get freed elsewhere could be a
problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r-- | equipment.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/equipment.c b/equipment.c index 2a96aec80..6396df0ca 100644 --- a/equipment.c +++ b/equipment.c @@ -23,7 +23,7 @@ void add_cylinder_description(cylinder_type_t *type) return; } if (i < 100) { - tank_info[i].name = desc; + tank_info[i].name = strdup(desc); tank_info[i].ml = type->size.mliter; tank_info[i].bar = type->workingpressure.mbar / 1000; } @@ -43,7 +43,7 @@ void add_weightsystem_description(weightsystem_t *weightsystem) } } if (i < 100) { - ws_info[i].name = desc; + ws_info[i].name = strdup(desc); ws_info[i].grams = weightsystem->weight.grams; } } |