mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
gtls: fix memory leak
Bug: http://curl.haxx.se/mail/lib-2011-01/0079.html Reported by: Quinn Slack
This commit is contained in:
parent
1d28efb9d1
commit
a9cd4f4ed4
11
lib/gtls.c
11
lib/gtls.c
@ -483,6 +483,7 @@ gtls_connect_step3(struct connectdata *conn,
|
|||||||
int rc;
|
int rc;
|
||||||
int incache;
|
int incache;
|
||||||
void *ssl_sessionid;
|
void *ssl_sessionid;
|
||||||
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
/* This function will return the peer's raw certificate (chain) as sent by
|
/* This function will return the peer's raw certificate (chain) as sent by
|
||||||
the peer. These certificates are in raw format (DER encoded for
|
the peer. These certificates are in raw format (DER encoded for
|
||||||
@ -701,11 +702,17 @@ gtls_connect_step3(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* store this session id */
|
/* store this session id */
|
||||||
return Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize);
|
result = Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize);
|
||||||
|
if(result) {
|
||||||
|
free(connect_sessionid);
|
||||||
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
return CURLE_OK;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user