Skip to content

Commit

Permalink
Fixes go pointer with go pointer check, which panicked on getting the…
Browse files Browse the repository at this point in the history
… cookies list
  • Loading branch information
datoga committed Jul 14, 2021
1 parent fd49ff2 commit c748ca3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions easy.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ import (
"fmt"
"mime"
"path"
"unsafe"
"sync"
"unsafe"
)

type CurlInfo C.CURLINFO
Expand Down Expand Up @@ -137,7 +137,7 @@ func (c *contextMap) Delete(k uintptr) {
delete(c.items, k)
}

var context_map = &contextMap {
var context_map = &contextMap{
items: make(map[uintptr]*CURL),
}

Expand Down Expand Up @@ -405,8 +405,9 @@ func (curl *CURL) Getinfo(info CurlInfo) (ret interface{}, err error) {
debugf("Getinfo %s", ret)
return ret, err
case C.CURLINFO_SLIST:
a_ptr_slist := new(C.struct_curl_slist)
var a_ptr_slist *C.struct_curl_slist
err := newCurlError(C.curl_easy_getinfo_slist(p, cInfo, &a_ptr_slist))
defer C.curl_slist_free_all(a_ptr_slist)
ret := []string{}
for a_ptr_slist != nil {
debugf("Getinfo %s %v", C.GoString(a_ptr_slist.data), a_ptr_slist.next)
Expand Down

0 comments on commit c748ca3

Please sign in to comment.