]> granicus.if.org Git - openssl/commitdiff
For portability use BUF_strndup instead of strndup.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 20 May 2014 10:18:30 +0000 (11:18 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 20 May 2014 10:23:23 +0000 (11:23 +0100)
(cherry picked from commit dcca7b13e9066443237dd3001ae52fd103151c98)

ssl/heartbeat_test.c

index 76496c8b465c2bf1ae7010c8936ff008b61a414d..26a01c08042cde02244c7610d1248a9e7f07d33e 100644 (file)
@@ -236,7 +236,7 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
                }
        else
                {
-               char* actual_payload = strndup((const char*)p, actual_payload_len);
+               char* actual_payload = BUF_strndup((const char*)p, actual_payload_len);
                if (strcmp(actual_payload, fixture.expected_return_payload) != 0)
                        {
                        printf("%s failed:\n  expected payload: \"%s\"\n  received: \"%s\"\n",
@@ -244,7 +244,7 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
                                                 actual_payload);
                        result = 1;
                        }
-               free(actual_payload);
+               OPENSSL_free(actual_payload);
                }
 
        if (result != 0)