allocations MustSucceed

This commit is contained in:
Andrew Johnson
2009-04-23 22:19:46 +00:00
parent f5f1c51b80
commit f0652aa1b6
4 changed files with 14 additions and 6 deletions

View File

@@ -25,13 +25,15 @@
static long addRec(struct dbCommon *prec)
{
prec->dpvt = calloc(1, sizeof(CALLBACK));
return 0;
return !prec->dpvt;
}
static long delRec(struct dbCommon *prec)
{
callbackCancelDelayed((CALLBACK *)prec->dpvt);
free(prec->dpvt);
if (prec->dpvt) {
callbackCancelDelayed((CALLBACK *)prec->dpvt);
free(prec->dpvt);
}
return 0;
}