mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 03:02:28 +00:00
Fix some static analysis issues
This commit is contained in:
parent
fb54604b31
commit
f147d3dde9
30 changed files with 375 additions and 266 deletions
|
@ -254,11 +254,15 @@ int __vcscanf(int callback(void *), //
|
|||
c = READ;
|
||||
}
|
||||
fpbufsize = FP_BUFFER_GROW;
|
||||
fpbuf = malloc(fpbufsize);
|
||||
fpbufcur = 0;
|
||||
fpbuf[fpbufcur++] = c;
|
||||
fpbuf[fpbufcur] = '\0';
|
||||
goto ConsumeFloatingPointNumber;
|
||||
if ((fpbuf = malloc(fpbufsize))) {
|
||||
fpbufcur = 0;
|
||||
fpbuf[fpbufcur++] = c;
|
||||
fpbuf[fpbufcur] = '\0';
|
||||
goto ConsumeFloatingPointNumber;
|
||||
} else {
|
||||
items = -1;
|
||||
goto Done;
|
||||
}
|
||||
default:
|
||||
items = einval();
|
||||
goto Done;
|
||||
|
@ -513,12 +517,16 @@ int __vcscanf(int callback(void *), //
|
|||
if (discard) {
|
||||
buf = NULL;
|
||||
} else if (ismalloc) {
|
||||
buf = malloc(bufsize * charbytes);
|
||||
struct FreeMe *entry;
|
||||
if (buf && (entry = calloc(1, sizeof(struct FreeMe)))) {
|
||||
entry->ptr = buf;
|
||||
entry->next = freeme;
|
||||
freeme = entry;
|
||||
if ((buf = malloc(bufsize * charbytes))) {
|
||||
struct FreeMe *entry;
|
||||
if (buf && (entry = calloc(1, sizeof(struct FreeMe)))) {
|
||||
entry->ptr = buf;
|
||||
entry->next = freeme;
|
||||
freeme = entry;
|
||||
}
|
||||
} else {
|
||||
items = -1;
|
||||
goto Done;
|
||||
}
|
||||
} else {
|
||||
buf = va_arg(va, void *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue