Size and number are switched in calloc sometimes. This PR fixes that.
Signed-off-by: Seija Kijin <doremylover123@gmail.com>
Co-authored-by: Seija Kijin <doremylover123@gmail.com>
/* We make it up in memory, then write it out if not internal */
size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
/* We make it up in memory, then write it out if not internal */
size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off);
- if (!(newdb = calloc(size, 1)))
+ if (!(newdb = calloc(1, size)))
return TDB_ERRCODE(TDB_ERR_OOM, -1);
/* Fill in the header */
return TDB_ERRCODE(TDB_ERR_OOM, -1);
/* Fill in the header */
bool client, struct tls_info **out)
{
if (out != NULL) {
bool client, struct tls_info **out)
{
if (out != NULL) {
- struct tls_info *tmp = calloc(sizeof(struct tls_info), 1);
+ struct tls_info *tmp = calloc(1, sizeof(struct tls_info));
if (!tmp) {
fatal("Allocation error");
}
if (!tmp) {
fatal("Allocation error");
}