Skip to content

Commit

Permalink
Merge pull request #2077 from mllg/master
Browse files Browse the repository at this point in the history
Initialize data->fn_rows in rbindlist (fixes #2019)
  • Loading branch information
mattdowle committed May 11, 2017
2 parents 366e355 + bb41fa9 commit d250ed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rbindlist.c
Expand Up @@ -502,7 +502,6 @@ static void preprocess(SEXP l, Rboolean usenames, Rboolean fill, struct preproce
// And warning that it'll be matched by names is not necessary, I think, as that's the default for 'rbind'. We
// should instead document it.
for (i=0; i<LENGTH(l); i++) { // isNull is checked already in rbindlist
data->fn_rows[i] = 0; // careful to initialize before continues as R_alloc above doesn't initialize
li = VECTOR_ELT(l, i);
if (isNull(li)) continue;
if (TYPEOF(li) != VECSXP) error("Item %d of list input is not a data.frame, data.table or list",i+1);
Expand All @@ -513,6 +512,7 @@ static void preprocess(SEXP l, Rboolean usenames, Rboolean fill, struct preproce
if (!isNull(col_name)) { data->colname = PROTECT(col_name); data->protecti++; }
if (usenames) { lnames = PROTECT(allocVector(VECSXP, LENGTH(l))); data->protecti++;}
for (i=0; i<LENGTH(l); i++) {
data->fn_rows[i] = 0; // careful to initialize before continues as R_alloc above doesn't initialize
li = VECTOR_ELT(l, i);
if (isNull(li)) continue;
if (TYPEOF(li) != VECSXP) error("Item %d of list input is not a data.frame, data.table or list",i+1);
Expand Down

0 comments on commit d250ed5

Please sign in to comment.