allocations MustSucceed

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

No files matched your search

+5 -3
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;
}