We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 773024a commit 171dd2fCopy full SHA for 171dd2f
oc2/ocrc.c
@@ -183,8 +183,10 @@ parseproxy(OCstate* state, char* v)
183
} else {
184
size_t host_len = strlen(host_pos);
185
state->proxy.host = malloc(sizeof(char) * host_len + 1);
186
- if (state->proxy.host == NULL)
187
- return OC_ENOMEM;
+ if (state->proxy.host == NULL) {
+ if(host_pos) free(host_pos);
188
+ return OC_ENOMEM;
189
+ }
190
191
strncpy(state->proxy.host, host_pos, host_len);
192
state->proxy.host[host_len] = '\0';
0 commit comments