Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion coffsyrup.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ int main(int argc, char **argv)
errx(EXIT_FAILURE, "The static symbol %s did not have a section number.", symname);
}

pmkrelocs = realloc(pmkrelocs, ++nmkrelocs * sizeof(*pmkrelocs));
void *tmp = realloc(pmkrelocs, (nmkrelocs + 1) * sizeof(*pmkrelocs));
if (!tmp) {
err(EXIT_FAILURE, "Failed to allocate relocation entry");
}
pmkrelocs = tmp;
nmkrelocs++;
pmkrelocs[nmkrelocs - 1].e_value = symtab[i].e_value;
pmkrelocs[nmkrelocs - 1].r_symndx = i;

Expand Down