Browse Source

com_psd(), cleanup storage more thoroughly (`win')

rlar 14 years ago
parent
commit
7b2c9db809
  1. 13
      src/frontend/com_fft.c

13
src/frontend/com_fft.c

@ -279,8 +279,8 @@ com_fft(wordlist *wl)
void void
com_psd(wordlist *wl) com_psd(wordlist *wl)
{ {
ngcomplex_t **fdvec;
double **tdvec;
ngcomplex_t **fdvec = NULL;
double **tdvec = NULL;
double *freq, *win, *time, *ave; double *freq, *win, *time, *ave;
double delta_t, span, noipower; double delta_t, span, noipower;
int mm; int mm;
@ -289,7 +289,7 @@ com_psd(wordlist *wl)
struct dvec *f, *vlist, *lv = NULL, *vec; struct dvec *f, *vlist, *lv = NULL, *vec;
struct pnode *pn, *names; struct pnode *pn, *names;
double *reald, *imagd;
double *reald = NULL, *imagd = NULL;
int sign, isreal; int sign, isreal;
double scaling, sum; double scaling, sum;
int order; int order;
@ -419,8 +419,7 @@ com_psd(wordlist *wl)
*/ */
} else { } else {
fprintf(cp_err, "Warning: unknown window type %s\n", window); fprintf(cp_err, "Warning: unknown window type %s\n", window);
tfree(win);
return;
goto done;
} }
} }
@ -457,7 +456,7 @@ com_psd(wordlist *wl)
} }
free_pnode_o(names); free_pnode_o(names);
if (!ngood) if (!ngood)
return;
goto done;
plot_cur = plot_alloc("spectrum"); plot_cur = plot_alloc("spectrum");
plot_cur->pl_next = plot_list; plot_cur->pl_next = plot_list;
@ -571,11 +570,13 @@ com_psd(wordlist *wl)
fdvec[i][j].cx_real = reald[j]; fdvec[i][j].cx_real = reald[j];
} }
done:
free(reald); free(reald);
free(imagd); free(imagd);
tfree(tdvec); tfree(tdvec);
tfree(fdvec); tfree(fdvec);
tfree(win);
} }

Loading…
Cancel
Save