curl_slist_append 函数定义如下:
struct curl_slist *curl_slist_append(struct curl_slist * list, const char * string );
下面的代码会因为我在进行实际 curl 调用之前释放缓冲区而导致分段错误吗?
char *buf = malloc(strlen(callname)+strlen("X-EBAY-API-CALL-NAME: ")+1);
sprintf(buf, "X-EBAY-API-CALL-NAME: %s", callname);
headers = curl_slist_append(headers, buf);
free(buf);