Skip to content

Commit cdc874d

Browse files
committed
8261601: free memory in early return in Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
Reviewed-by: clanger, dfuchs, bpb
1 parent e2d52ae commit cdc874d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -475,6 +475,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
475475
iov->iov_len = SCTP_NOTIFICATION_SIZE - rv;
476476
if ((rv = recvmsg(fd, msg, flags)) < 0) {
477477
handleSocketError(env, errno);
478+
free(newBuf);
478479
return 0;
479480
}
480481
bufp = newBuf;

0 commit comments

Comments
 (0)