forked from github/server
CID 22491 FORWARD_NULL
github issue #352 fals positive, rewriting code to appease coverity
This commit is contained in:
parent
62d7e9e944
commit
58c1d83c9e
1 changed files with 5 additions and 6 deletions
|
@ -91,23 +91,22 @@ void crt_register(const struct message_type *mtype)
|
|||
crt = crt->next;
|
||||
}
|
||||
if (!crt) {
|
||||
int i;
|
||||
crt = malloc(sizeof(crmessage_type));
|
||||
crt->mtype = mtype;
|
||||
crt->next = crtypes[hash];
|
||||
crtypes[hash] = crt;
|
||||
if (mtype->nparameters > 0) {
|
||||
int i;
|
||||
crt->renderers = malloc(sizeof(tostring_f) * mtype->nparameters);
|
||||
}
|
||||
else {
|
||||
crt->renderers = NULL;
|
||||
}
|
||||
|
||||
/* can be scrapped for memory vs. speed */
|
||||
for (i = 0; i != mtype->nparameters; ++i) {
|
||||
crt->renderers[i] = tsf_find(mtype->types[i]->name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
crt->renderers = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int cr_render(const message * msg, char *buffer, const void *userdata)
|
||||
|
|
Loading…
Reference in a new issue