Skip to content

Commit c73005e

Browse files
committed
Fix use-after-free warning (fixes #273)
1 parent 90250be commit c73005e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/sas/readstat_sas7bdat_read.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,6 @@ static readstat_variable_t *sas7bdat_init_variable(sas7bdat_ctx_t *ctx, int i,
703703

704704
cleanup:
705705
if (retval != READSTAT_OK) {
706-
free(variable);
707706
if (out_retval)
708707
*out_retval = retval;
709708

@@ -716,6 +715,8 @@ static readstat_variable_t *sas7bdat_init_variable(sas7bdat_ctx_t *ctx, int i,
716715
}
717716
}
718717

718+
free(variable);
719+
719720
return NULL;
720721
}
721722

0 commit comments

Comments
 (0)