Commit a545921
committed
HDF5: Fix Segfault with libSplash Files (openPMD#962)
* HDF5: Fix Segfault with libSplash Files
Fix a segfault (on some systems) with legacy libSplash HDF5 files.
From the docs:
```
Name: H5Tget_member_name
...
The HDF5 Library allocates a buffer to receive the name of the
field. The caller must subsequently free the buffer with
H5free_memory.
```
Refs.:
- https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetMemberName
- https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-FreeMemory
* avoid undefined behavior in str(n)cmp
Passing potential `nullptr`s is undefined behavior.
* Clang-Tidy: Intentional Branch Clone1 parent ff862b5 commit a545921
1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1414 | 1414 | | |
1415 | 1415 | | |
1416 | 1416 | | |
1417 | | - | |
1418 | | - | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1419 | 1420 | | |
1420 | 1421 | | |
1421 | 1422 | | |
| |||
1436 | 1437 | | |
1437 | 1438 | | |
1438 | 1439 | | |
1439 | | - | |
1440 | | - | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1441 | 1443 | | |
1442 | 1444 | | |
1443 | 1445 | | |
| |||
1453 | 1455 | | |
1454 | 1456 | | |
1455 | 1457 | | |
1456 | | - | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
1457 | 1461 | | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1461 | 1465 | | |
1462 | 1466 | | |
1463 | 1467 | | |
| |||
1488 | 1492 | | |
1489 | 1493 | | |
1490 | 1494 | | |
1491 | | - | |
| 1495 | + | |
1492 | 1496 | | |
1493 | 1497 | | |
1494 | 1498 | | |
| |||
0 commit comments