summaryrefslogtreecommitdiffstats
path: root/tools/h5findshd.c
diff options
context:
space:
mode:
authorPaul Harten <pharten@ncsa.uiuc.edu>1999-01-12 15:48:18 (GMT)
committerPaul Harten <pharten@ncsa.uiuc.edu>1999-01-12 15:48:18 (GMT)
commit2362b4e0f0dda6237c994551e01cdd2773bad019 (patch)
tree628b5ae14e2303cb3040c25adef4964e14296510 /tools/h5findshd.c
parent6c30f0ae168fa5e7cdfb1553ef41553b20350573 (diff)
downloadhdf5-2362b4e0f0dda6237c994551e01cdd2773bad019.zip
hdf5-2362b4e0f0dda6237c994551e01cdd2773bad019.tar.gz
hdf5-2362b4e0f0dda6237c994551e01cdd2773bad019.tar.bz2
[svn-r1021] Purpose:
Bug fix Problem: Segmentation fault when attempting to free NULL or uninitialized pointers. Problem noticed on Linux and HPUX10.20 platforms. Solution: Initialialize the pointer to NULL. Execute the "free" statement upon the condition that the pointer is not equal to NULL (i.e. after the allocation has taken place.) Platform tested: Linux, HPUX10.20, Solaris2.5
Diffstat (limited to 'tools/h5findshd.c')
-rw-r--r--tools/h5findshd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/h5findshd.c b/tools/h5findshd.c
index b5cd0f9..20d9492 100644
--- a/tools/h5findshd.c
+++ b/tools/h5findshd.c
@@ -92,9 +92,15 @@ int i;
void
free_table (void){
- HDfree(&group_table);
- HDfree(&dset_table);
- HDfree(&type_table);
+ if (group_table.objs != NULL) {
+ HDfree(group_table.objs);
+ }
+ if (dset_table.objs != NULL) {
+ HDfree(dset_table.objs);
+ }
+ if (type_table.objs != NULL) {
+ HDfree(type_table.objs);
+ }
}