We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 171dd2f commit 02a7d45Copy full SHA for 02a7d45
oc2/ocrc.c
@@ -173,8 +173,11 @@ parseproxy(OCstate* state, char* v)
173
*port_sep = '\0';
174
host_len = strlen(host_pos);
175
state->proxy.host = malloc(sizeof(char) * host_len + 1);
176
- if (state->proxy.host == NULL)
177
- return OC_ENOMEM;
+ if (state->proxy.host == NULL) {
+ if(port_pos) free(port_pos);
178
+ if(host_pos) free(host_pos);
179
+ return OC_ENOMEM;
180
+ }
181
182
strncpy(state->proxy.host, host_pos, host_len);
183
state->proxy.host[host_len] = '\0';
0 commit comments