caget missing NULL check

This commit is contained in:
Michael Davidsaver authored and mdavidsaver committed 2026-07-21 07:48:23 -05:00
1 parent 50f4eaa9c0
commit 7dc46f2168
1 file changed
+8 -3
+8 -3
View File
@@ -126,10 +126,15 @@ static void event_handler (evargs args)
ppv->status = args.status;
if (args.status == ECA_NORMAL)
{
epicsUInt32 nBytes = dbr_size_n(args.type, args.count);
ppv->dbrType = args.type;
ppv->value = calloc(1, dbr_size_n(args.type, args.count));
memcpy(ppv->value, args.dbr, dbr_size_n(args.type, args.count));
ppv->nElems = args.count;
ppv->value = calloc(1, nBytes);
if (ppv->value) {
memcpy(ppv->value, args.dbr, nBytes);
ppv->nElems = args.count;
} else {
ppv->status = ECA_ALLOCMEM;
}
nRead++;
}
}