We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code should cleanup correctly src:
... /* get the dimensions and type */ fits_get_img_dim(iodesc->ff, &no_dims, &status); fits_get_img_equivtype(iodesc->ff, &iodesc->type, &status); fits_get_img_size(iodesc->ff, 2, iodesc->dims, &status); if (status) { ioerr(BADDIMS, iodesc, status); return NULL; } if (no_dims == 2) { /* Nothing */ } else if (no_dims == 1) { iodesc->dims[1] = 0; } else if (no_dims == 0) { iodesc->dims[0] = 0; iodesc->dims[1] = 0; } else { ioerr(BADDIMS, iodesc, 0); return NULL; } ...
should be:
... /* get the dimensions and type */ fits_get_img_dim(iodesc->ff, &no_dims, &status); fits_get_img_equivtype(iodesc->ff, &iodesc->type, &status); fits_get_img_size(iodesc->ff, 2, iodesc->dims, &status); if (status) { ioerr(BADDIMS, iodesc, status); free(iodesc->extname); free(iodesc->filename); free(iodesc); return NULL; } if (no_dims == 2) { /* Nothing */ } else if (no_dims == 1) { iodesc->dims[1] = 0; } else if (no_dims == 0) { iodesc->dims[0] = 0; iodesc->dims[1] = 0; } else { ioerr(BADDIMS, iodesc, 0); free(iodesc->extname); free(iodesc->filename); free(iodesc); return NULL; } ...
There may be an existing helper func that could be used here.
In addition, the free(tmp) should also nullify tmp - src.
free(tmp)
tmp
The above may not be everything needed.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following code should cleanup correctly src:
should be:
There may be an existing helper func that could be used here.
In addition, the
free(tmp)
should also nullifytmp
- src.The above may not be everything needed.
The text was updated successfully, but these errors were encountered: