Skip to content

Commit

Permalink
Merge pull request #61 from kbarbary/fix-issue-56
Browse files Browse the repository at this point in the history
fix issue 56
  • Loading branch information
kbarbary committed Jun 13, 2018
2 parents bb7cf78 + c427c9d commit 1d8aa3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/extract.c
Expand Up @@ -390,8 +390,7 @@ int sep_extract(sep_image *image, float thresh, int thresh_type,
{
if (conv)
{
free(cdscan);
cdscan = NULL;
free(cdscan); // cdscan set to dummyscan below
if (filter_type == SEP_FILTER_MATCHED)
{
for (xl=0; xl<stacksize; xl++)
Expand Down Expand Up @@ -732,8 +731,9 @@ int sep_extract(sep_image *image, float thresh, int thresh_type,
if (status != RETURN_OK)
{
/* free cdscan if we didn't do it on the last `yl` line */
if ((cdscan != NULL) && (cdscan != dummyscan))
if (conv && (cdscan != dummyscan))
free(cdscan);

/* clean up catalog if it was allocated */
sep_catalog_free(cat);
cat = NULL;
Expand Down

0 comments on commit 1d8aa3b

Please sign in to comment.