Index: trunk/src/libcschem/hierarchy.c =================================================================== --- trunk/src/libcschem/hierarchy.c (revision 10251) +++ trunk/src/libcschem/hierarchy.c (revision 10252) @@ -163,7 +163,7 @@ csch_sheet_t *csch_hier_find_by_path(const csch_sheet_t *sheet, const char *path, int add_to_prj_as_aux) { csch_project_t *prj = (csch_project_t *)sheet->hidlib.project; - csch_sheet_t *res; + csch_sheet_t *res = NULL; char *dirname, *new_path, *nr_path; long n; @@ -175,6 +175,12 @@ new_path = rnd_concat(dirname, "/", path, NULL); free(dirname); nr_path = rnd_lrealpath(new_path); + + if (nr_path == NULL) { + rnd_message(RND_MSG_ERROR, "Hirearchic: sheet with path '%s' not found on the file system...\n", new_path); + free(new_path); + goto done; + } free(new_path); /* search in project first */