From d4c9482ab6c560cf99583133858464aa74c73a1d Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 6 Oct 2014 10:48:11 -0600 Subject: [PATCH] Coverity: 1243512, Resource Leak. --- libdispatch/ddispatch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libdispatch/ddispatch.c b/libdispatch/ddispatch.c index 525a88e28..c8082129c 100644 --- a/libdispatch/ddispatch.c +++ b/libdispatch/ddispatch.c @@ -90,6 +90,7 @@ NC_findtestserver(const char* path, const char** servers) if(stat == NC_NOERR) return url; } + if(url) free(url); #endif #endif return NULL; @@ -121,7 +122,7 @@ NC_testurl(const char* path) if(strcmp(tmpurl->protocol,protolist->protocol) == 0) { isurl=1; break; - } + } } ncurifree(tmpurl); return isurl; @@ -163,10 +164,10 @@ NC_urlmodel(const char* path) free(tmpurl->protocol); tmpurl->protocol = strdup(protolist->substitute); } - break; + break; } } - } + } /* Force NC_DISPATCH_NC3 if necessary */ if((model & NC_DISPATCH_NC4) == 0)