Skip to content

Commit

Permalink
PROTECT() names vector (#6265)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 21, 2024
1 parent f952062 commit b303cd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rbindlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg)

int nprotect = 0;
SEXP ans = PROTECT(allocVector(VECSXP, idcol + ncol)); nprotect++;
SEXP ansNames;
setAttrib(ans, R_NamesSymbol, ansNames=allocVector(STRSXP, idcol + ncol));
SEXP ansNames = PROTECT(allocVector(STRSXP, idcol + ncol)); nprotect++;
setAttrib(ans, R_NamesSymbol, ansNames);
if (idcol) {
SET_STRING_ELT(ansNames, 0, STRING_ELT(idcolArg, 0));
SEXP idval, listNames=getAttrib(l, R_NamesSymbol);
Expand Down

0 comments on commit b303cd4

Please sign in to comment.