doh->state.internal = TRUE;
doh->master_mid = data->mid; /* master transfer of this one */
- if(Curl_meta_set(doh, CURL_EZM_DOH_PROBE, doh_req, doh_probe_dtor)) {
- result = CURLE_OUT_OF_MEMORY;
+ result = Curl_meta_set(doh, CURL_EZM_DOH_PROBE, doh_req, doh_probe_dtor);
+ doh_req = NULL; /* call took ownership */
+ if(result)
goto error;
- }
- doh_req = NULL;
/* DoH handles must not inherit private_data. The handles may be passed to
the user via callbacks and the user will be able to identify them as
if(!Curl_hash_add2(&data->meta_hash, CURL_UNCONST(key), strlen(key) + 1,
meta_data, meta_dtor)) {
meta_dtor(CURL_UNCONST(key), strlen(key) + 1, meta_data);
+ return CURLE_OUT_OF_MEMORY;
}
return CURLE_OK;
}
ps = calloc(1, sizeof(*ps));
if(!ps)
return NULL;
- if(Curl_conn_meta_set(conn, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor)) {
- free(ps);
+ if(Curl_conn_meta_set(conn, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor))
return NULL;
- }
return ps;
}
ps = calloc(1, sizeof(*ps));
if(!ps)
return NULL;
- if(Curl_meta_set(data, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor)) {
- free(ps);
+ if(Curl_meta_set(data, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor))
return NULL;
- }
return ps;
}
if(!Curl_hash_add2(&conn->meta_hash, CURL_UNCONST(key), strlen(key) + 1,
meta_data, meta_dtor)) {
meta_dtor(CURL_UNCONST(key), strlen(key) + 1, meta_data);
+ return CURLE_OUT_OF_MEMORY;
}
return CURLE_OK;
}
+
void Curl_conn_meta_remove(struct connectdata *conn, const char *key)
{
Curl_hash_delete(&conn->meta_hash, CURL_UNCONST(key), strlen(key) + 1);