Skip to content

Commit 6f5e9f3

Browse files
committed
Check if easy response is null when returning a char *
1 parent 818f8d6 commit 6f5e9f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/curl_easy_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ namespace curl {
5151
public:
5252
curl_easy_info(char *pointer) : _pointer(pointer) {}
5353
std::string get() const {
54+
if (_pointer == nullptr) {
55+
return std::string('');
56+
}
5457
return std::string(_pointer);
5558
}
5659
private:

0 commit comments

Comments
 (0)