diff --git a/libdispatch/ncuri.c b/libdispatch/ncuri.c index b59d069e1..632231048 100644 --- a/libdispatch/ncuri.c +++ b/libdispatch/ncuri.c @@ -347,7 +347,11 @@ ncuriparse(const char* uri0, NCURI** durip) fprintf(stderr,"\n"); } #endif - if(durip != NULL) *durip = duri; + if(durip != NULL) + *durip = duri; + else + ncurifree(duri); + return 1; fail: diff --git a/ncgen/ncgen.y b/ncgen/ncgen.y index 55b02aa29..103a2a335 100644 --- a/ncgen/ncgen.y +++ b/ncgen/ncgen.y @@ -1003,6 +1003,7 @@ makeconstdata(nc_type nctype) consttype = nctype; con.nctype = nctype; con.lineno = lineno; + con.filled = 0; switch (nctype) { case NC_CHAR: con.value.charv = char_val; break; case NC_BYTE: con.value.int8v = byte_val; break; diff --git a/ncgen3/load.c b/ncgen3/load.c index 0eae7f1eb..3da47126e 100644 --- a/ncgen3/load.c +++ b/ncgen3/load.c @@ -67,7 +67,7 @@ gen_load_c( double *doublevalp; char stmnt[C_MAX_STMNT]; size_t stmnt_len; - char s2[C_MAX_STMNT]; + char s2[C_MAX_STMNT] = {'\0'}; if (!vars[varnum].has_data) return;