Skip to content

Commit 171dd2f

Browse files
author
Ward Fisher
committed
Coverity issue 711880
1 parent 773024a commit 171dd2f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

oc2/ocrc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ parseproxy(OCstate* state, char* v)
183183
} else {
184184
size_t host_len = strlen(host_pos);
185185
state->proxy.host = malloc(sizeof(char) * host_len + 1);
186-
if (state->proxy.host == NULL)
187-
return OC_ENOMEM;
186+
if (state->proxy.host == NULL) {
187+
if(host_pos) free(host_pos);
188+
return OC_ENOMEM;
189+
}
188190

189191
strncpy(state->proxy.host, host_pos, host_len);
190192
state->proxy.host[host_len] = '\0';

0 commit comments

Comments
 (0)