On 19/10/18 17:56, David Sommerseth wrote:
> From: Heiko Hund <heiko.h...@sophos.com>
> 
> Prevent the re-allocations of memory when the internal argv grows
> beyond 2 and 4 arguments by initially allocating argv to hold up to
> 7 (+ trailing NULL) pointers.
> 
> While at it rename argv_reset to argv_free to actually express
> what's going on. Redo the argv_reset functionality so that it can
> be used to actually reset the argv without re-allocation.
> 
> Signed-off-by: Heiko Hund <heiko.h...@sophos.com>
> ---
>  src/openvpn/argv.c                   | 81 ++++++++++++++--------------
>  src/openvpn/argv.h                   |  2 +-
>  src/openvpn/console_systemd.c        |  2 +-
>  src/openvpn/init.c                   | 15 ++----
>  src/openvpn/lladdr.c                 |  2 +-
>  src/openvpn/multi.c                  | 10 ++--
>  src/openvpn/options.c                |  2 +-
>  src/openvpn/plugin.c                 |  2 +-
>  src/openvpn/route.c                  |  8 +--
>  src/openvpn/socket.c                 |  4 +-
>  src/openvpn/ssl_verify.c             |  6 +--
>  src/openvpn/tun.c                    | 38 ++++++-------
>  tests/unit_tests/openvpn/test_argv.c | 41 +++++++++-----
>  13 files changed, 110 insertions(+), 103 deletions(-)

This is a pure rebase of [0, 1].  In my initial review, I questioned the need
to keep argv_str().  I decided to keep the argv_str() as it makes the usage of
struct argv based processing simpler; no need for the caller to know inner
details of struct argv.

[0] <https://patchwork.openvpn.net/patch/72/>
[1] <20171112082736.15578-1-heiko.hund@sophos.com">http://mid.mail-archive.com/20171112082736.15578-1-heiko.hund@sophos.com>


-- 
kind regards,

David Sommerseth
OpenVPN Inc


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to