Loading lib/hash.c +11 −3 Original line number Diff line number Diff line Loading @@ -127,10 +127,18 @@ mk_hash_element(char *key, size_t key_len, const void *p) (curl_hash_element *) malloc(sizeof(curl_hash_element)); if(he) { he->key = strdup(key); char *dup = strdup(key); if(dup) { he->key = dup; he->key_len = key_len; he->ptr = (void *) p; } else { /* failed to duplicate the key, free memory and fail */ free(he); he = NULL; } } return he; } Loading Loading
lib/hash.c +11 −3 Original line number Diff line number Diff line Loading @@ -127,10 +127,18 @@ mk_hash_element(char *key, size_t key_len, const void *p) (curl_hash_element *) malloc(sizeof(curl_hash_element)); if(he) { he->key = strdup(key); char *dup = strdup(key); if(dup) { he->key = dup; he->key_len = key_len; he->ptr = (void *) p; } else { /* failed to duplicate the key, free memory and fail */ free(he); he = NULL; } } return he; } Loading