diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-06-01 18:44:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 18:44:45 +0200 |
commit | b11da4d84b1323e2ba56071a85fabd5c7246d999 (patch) | |
tree | 2155ae34a99567a82d5dfa20d718d6cdf1c19edc | |
parent | d31df38777e2f6b2056361eee771b705370b30d5 (diff) | |
parent | fa157795d06a30e6509b7521938e9a550c47d3c4 (diff) | |
download | monitoring-plugins-b11da4d.tar.gz |
Merge pull request #1537 from jframeau/patch-1
Avoid working with free'ed memory
-rw-r--r-- | plugins/check_curl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 4141b326..715af431 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -1920,11 +1920,11 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line) | |||
1920 | 1920 | ||
1921 | /* Human readable message: "Not Found" CRLF */ | 1921 | /* Human readable message: "Not Found" CRLF */ |
1922 | 1922 | ||
1923 | free( first_line_buf ); | ||
1924 | p = strtok( NULL, "" ); | 1923 | p = strtok( NULL, "" ); |
1925 | if( p == NULL ) { free( status_line->first_line ); return -1; } | 1924 | if( p == NULL ) { free( status_line->first_line ); return -1; } |
1926 | status_line->msg = status_line->first_line + ( p - first_line_buf ); | 1925 | status_line->msg = status_line->first_line + ( p - first_line_buf ); |
1927 | 1926 | free( first_line_buf ); | |
1927 | |||
1928 | return 0; | 1928 | return 0; |
1929 | } | 1929 | } |
1930 | 1930 | ||