aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 411a1b63..c997ed12 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -461,7 +461,10 @@ static void *get_image(void *qp)
} else {
rval = fgets(line, 1023, qargs->fh);
- if ( rval == NULL ) return NULL;
+ if ( rval == NULL ) {
+ free(pargs);
+ return NULL;
+ }
chomp(line);
pargs->filename = malloc(strlen(qargs->prefix)+strlen(line)+1);
snprintf(pargs->filename, 1023, "%s%s", qargs->prefix, line);
@@ -884,11 +887,14 @@ int main(int argc, char *argv[])
cleanup_indexing(ipriv);
+ free(indm);
+ free(ipriv);
free(prefix);
free(det->panels);
free(det);
cell_free(cell);
- if ( fh != stdout ) fclose(fh);
+ if ( fh != stdin ) fclose(fh);
+ if ( ofh != stdout ) fclose(ofh);
free(sym);
STATUS("There were %i images, of which %i could be indexed.\n",