Corrected a stored value that's never read issue detected by static analysis.
@@ -196,10 +196,9 @@ static void
rctrim(char* text)
{
char* p = text;
- size_t len;
+ size_t len = 0;
int i;
- len = strlen(text);
/* locate first non-trimchar */
for(;*p;p++) {
if(strchr(TRIMCHARS,*p) == NULL) break; /* hit non-trim char */
@@ -297,6 +296,7 @@ rccompile(const char* path)
char* rtag = strchr(line,RTAG);
if(rtag == NULL) {
nclog(NCLOGERR, "Malformed [url] in %s entry: %s",path,line);
+ free(triple);
continue;
}
line = rtag + 1;
@@ -305,6 +305,7 @@ rccompile(const char* path)
if(uri) ncurifree(uri);
if(ncuriparse(url,&uri) != NCU_OK) {
nclog(NCLOGERR, "Malformed [url] in %s entry: %s",path,line);
+ free(triple);
continue;
}
ncbytesclear(tmp);
@@ -441,4 +442,3 @@ storedump(char* msg, NClist* triples)
fflush(stderr);
}
#endif
-
