-/* $OpenBSD: exf.c,v 1.48 2021/10/25 14:17:24 dv Exp $ */
+/* $OpenBSD: exf.c,v 1.49 2024/02/14 03:07:58 jsg Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
if ((frp->tname = strdup(tname)) == NULL ||
(frp->name == NULL && (frp->name = strdup(tname)) == NULL)) {
free(frp->tname);
+ frp->tname = NULL;
msgq(sp, M_SYSERR, NULL);
(void)unlink(tname);
goto err;
TAILQ_REMOVE(&sp->gp->frefq, frp, q);
free(frp->name);
free(frp);
+ frp = NULL;
}
sp->frp = NULL;
}
* Close the db structure.
*/
if (ep->db->close != NULL && ep->db->close(ep->db) && !force) {
- msgq_str(sp, M_SYSERR, frp->name, "%s: close");
+ if (frp)
+ msgq_str(sp, M_SYSERR, frp->name, "%s: close");
+ else
+ msgq(sp, M_SYSERR, "close");
++ep->refcnt;
return (1);
}