Skip to content

Commit 6130c6c

Browse files
committed
add PROTECT for getAttrib rbindlist
1 parent 978264b commit 6130c6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rbindlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor
305305
if (isOrdered(thisCol)) {
306306
orderedFactor = true;
307307
int thisLen = length(getAttrib(thisCol, R_LevelsSymbol));
308-
if (thisLen>longestLen) { longestLen=thisLen; longestLevels=getAttrib(thisCol, R_LevelsSymbol); /*for warnings later ...*/longestW=w; longestI=i; }
308+
if (thisLen>longestLen) { longestLen=thisLen; longestLevels=PROTECT(getAttrib(thisCol, R_LevelsSymbol)); nprotect++; /*for warnings later ...*/longestW=w; longestI=i; }
309309
}
310310
} else if (!isString(thisCol)) anyNotStringOrFactor=true; // even for length 0 columns for consistency; test 2113.3
311311
if (INHERITS(thisCol, char_integer64)) {

0 commit comments

Comments
 (0)