Avoid NULL dereference in free()

Former-commit-id: d257e5a0bfde5c4f6a6d7380eace24feba518b06
This commit is contained in:
Marek Nečada 2019-03-03 00:43:40 +00:00
parent 8afa775428
commit f785c7de29
1 changed files with 10 additions and 8 deletions

View File

@ -485,14 +485,16 @@ qpms_scatsys_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, const qp
void qpms_scatsys_free(qpms_scatsys_t *ss) { void qpms_scatsys_free(qpms_scatsys_t *ss) {
free(ss->tm); if(ss) {
free(ss->p); free(ss->tm);
free(ss->fecv_pstarts); free(ss->p);
free(ss->tm_sym_map); free(ss->fecv_pstarts);
free(ss->p_sym_map); free(ss->tm_sym_map);
free(ss->otspace); free(ss->p_sym_map);
free(ss->p_orbitinfo); free(ss->otspace);
free(ss->orbit_types); free(ss->p_orbitinfo);
free(ss->orbit_types);
}
free(ss); free(ss);
} }