Squaed a potential memory leak.
@@ -368,7 +368,10 @@ ncuriparse(const char* uri0, NCURI** durip)
duri->fragment = nulldup(tmp.fragment);
duri->fraglist = tmp.fraglist; tmp.fraglist = NULL;
duri->querylist = tmp.querylist; tmp.querylist = NULL;
- if(durip) *durip = duri;
+ if(durip)
+ *durip = duri;
+ else
+ free(duri);
#ifdef NCXDEBUG
{
@@ -388,6 +391,7 @@ ncuriparse(const char* uri0, NCURI** durip)
done:
if(uri != NULL)
free(uri);
+
freestringlist(params);
freestringlist(querylist);
freestringvec(tmp.fraglist);
