Skip to content
New issue

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

Fix Memory Leak #2598

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dap4_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pingurl4_SOURCES = pingurl4.c
if ENABLE_DAP_REMOTE_TESTS
if BUILD_UTILITIES
# relies on ncdump
TESTS += test_hyrax.sh test_thredds.sh
TESTS += test_hyrax.sh
# TESTS += test_thredds.sh
if AX_IGNORE
TESTS += test_remote.sh
endif
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ obsolete/fan_utils.html bestpractices.md filters.md indexing.md
inmemory.md DAP2.dox FAQ.md
known_problems.md
COPYRIGHT.dox user_defined_formats.md DAP4.md DAP4.dox
testserver.dox byterange.dox filters.md nczarr.md auth.md quantize.md)
testserver.dox byterange.md filters.md nczarr.md auth.md quantize.md)

ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
2 changes: 1 addition & 1 deletion docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ windows-binaries.md dispatch.md building-with-cmake.md CMakeLists.txt groups.dox
notes.md install-fortran.md credits.md auth.md filters.md \
obsolete/fan_utils.html indexing.dox inmemory.md FAQ.md \
known_problems.md COPYRIGHT.md inmeminternal.dox testserver.dox \
byterange.dox nczarr.md quantize.md all-error-codes.md
byterange.md nczarr.md quantize.md all-error-codes.md

# Turn off parallel builds in this directory.
.NOTPARALLEL:
Expand Down
3 changes: 3 additions & 0 deletions libdispatch/dvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,9 @@ NC_check_nulls(int ncid, int varid, const size_t *start, size_t **count,
pointer back to this function, when you're done with the data, and
it will free the string memory.

WARNING: This does not free the data vector itself, only
the strings to which it points.

@param len The number of character arrays in the array.
@param data The pointer to the data array.

Expand Down
3 changes: 2 additions & 1 deletion ncdump/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ void nc_get_att_single_string(const int ncid, const int varid,
*str_out = emalloc((att_str_len + 1) * att->tinfo->size);
(*str_out)[att_str_len] = '\0';
strncpy(*str_out, att_strings[0], att_str_len);
nc_free_string(att->len, att_strings);
nc_free_string(att->len, att_strings); /* Warning: does not free att_strings */
free(att_strings);
} else {
fprintf(stderr,"nc_get_att_single_string: unknown attribute type: %d\n", att->type);
fprintf(stderr," must use one of: NC_CHAR, NC_STRING\n");
Expand Down