aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-03-10 20:19:58 +0100
committerSverker Eriksson <[email protected]>2014-03-10 20:19:58 +0100
commitdbdf33a57b8e92fc9a45029ed3fef0f70c852909 (patch)
tree6bfbd25c8d13dc872b10e1cdb2ad85f8a7d4c06b
parent78796d03ac341da53e9c8b7f8d69cc3c0a949c14 (diff)
downloadotp-dbdf33a57b8e92fc9a45029ed3fef0f70c852909.tar.gz
otp-dbdf33a57b8e92fc9a45029ed3fef0f70c852909.tar.bz2
otp-dbdf33a57b8e92fc9a45029ed3fef0f70c852909.zip
erl_interface: Fix mem leak in ei_decode_encode_test
-rw-r--r--lib/erl_interface/test/all_SUITE_data/ei_runner.c6
-rw-r--r--lib/erl_interface/test/all_SUITE_data/ei_runner.h3
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/erl_interface/test/all_SUITE_data/ei_runner.c b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
index cdf32b48c4..196a77dce5 100644
--- a/lib/erl_interface/test/all_SUITE_data/ei_runner.c
+++ b/lib/erl_interface/test/all_SUITE_data/ei_runner.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2014. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -182,6 +182,10 @@ char *read_packet(int *len)
return io_buf;
}
+void free_packet(char* packet)
+{
+ free(packet);
+}
/***********************************************************************
* S e n d i n g r e p l i e s
diff --git a/lib/erl_interface/test/all_SUITE_data/ei_runner.h b/lib/erl_interface/test/all_SUITE_data/ei_runner.h
index 96d6a1cbf7..a037341d57 100644
--- a/lib/erl_interface/test/all_SUITE_data/ei_runner.h
+++ b/lib/erl_interface/test/all_SUITE_data/ei_runner.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2014. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -44,6 +44,7 @@ void run_tests(char* argv0, TestCase cases[], unsigned number);
int get_bin_term(ei_x_buff* x, ei_term* term);
char *read_packet(int *len);
+void free_packet(char*);
/*
* Sending replies.
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
index 1ef17d4161..649138b471 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
@@ -310,7 +310,7 @@ void decode_encode(struct Type** tv, int nobj)
send_buffer(out_buf, outp - out_buf);
send_buffer(arg.buff, arg.index);
ei_x_free(&arg);
- free(packet);
+ free_packet(packet);
}
void decode_encode_one(struct Type* t)