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
In g2_addgrid() we have this code:
if (mapgrid->needext) { free(mapgrid); mapgrid = extgridtemplate(igds[4], igdstmpl); }
This causes extra memory to be allocated in gridtemplates.c:
if (number == 120) { new->extlen = list[1] * 2; new->ext = malloc(sizeof(g2int) * new->extlen);
Note that the ext pointer now has memory allocated. But when it's time to free this data, there is no call to free the ext memory (from g2_addgrid.c):
/* Pack template extension, if appropriate. */ j = mapgrid->maplen; if (mapgrid->needext && mapgrid->extlen > 0) { for (i = 0; i < mapgrid->extlen; i++) { nbits = abs(mapgrid->ext[i]) * 8; if (mapgrid->ext[i] >= 0 || igdstmpl[j] >= 0) sbit(cgrib, igdstmpl + j, iofst, nbits); else { sbit(cgrib, &one, iofst, 1); temp = abs(igdstmpl[j]); sbit(cgrib, &temp, iofst + 1, nbits - 1); } iofst = iofst + nbits; j++; } } free(mapgrid);
Note that mapgrid is freed, but mapgrid->ext needs to be freed first.
The text was updated successfully, but these errors were encountered:
edwardhartnett
Successfully merging a pull request may close this issue.
In g2_addgrid() we have this code:
This causes extra memory to be allocated in gridtemplates.c:
Note that the ext pointer now has memory allocated. But when it's time to free this data, there is no call to free the ext memory (from g2_addgrid.c):
Note that mapgrid is freed, but mapgrid->ext needs to be freed first.
The text was updated successfully, but these errors were encountered: