Source
717
717
/* Sanity check */
718
718
HDassert(ent);
719
719
HDassert(udata && udata->heap);
720
720
721
721
/* Get name offset in heap */
722
722
name_off = ent->name_off;
723
723
724
724
if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL)
725
725
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name")
726
726
727
-
HDassert(name);
728
-
udata->name = H5MM_strdup(name);
729
-
HDassert(udata->name);
727
+
if((udata->name = H5MM_strdup(name)) == NULL)
728
+
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to duplicate symbol table link name")
730
729
731
730
done:
732
731
FUNC_LEAVE_NOAPI(ret_value)
733
732
} /* end H5G_stab_get_name_by_idx_cb */
734
733
735
734
•
736
735
/*-------------------------------------------------------------------------
737
736
* Function: H5G__stab_get_name_by_idx
738
737
*
739
738
* Purpose: Returns the name of objects in the group by giving index.
941
940
942
941
FUNC_ENTER_NOAPI_NOINIT
943
942
944
943
/* Sanity check */
945
944
HDassert(ent);
946
945
HDassert(udata && udata->heap);
947
946
948
947
/* Get a pointer to the link name */
949
948
if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL)
950
949
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name")
951
-
HDassert(name);
952
950
953
951
/* Convert the entry to a link */
954
952
if(H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0)
955
953
HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link")
956
954
udata->found = TRUE;
957
955
958
956
done:
959
957
FUNC_LEAVE_NOAPI(ret_value)
960
958
} /* end H5G_stab_lookup_by_idx_cb */
961
959