Ticket #2375: 0003-tftpDriver-don-t-free-directory-node-s-path-string.patch

File 0003-tftpDriver-don-t-free-directory-node-s-path-string.patch, 1016 bytes (added by Michael Davidsaver, on 08/01/15 at 13:24:30)

don't free directory node's path string

  • cpukit/libnetworking/lib/tftpDriver.c

    From 912343ad64f11dc9873457fd0898c00e7245182b Mon Sep 17 00:00:00 2001
    From: Michael Davidsaver <mdavidsaver@gmail.com>
    Date: Sun, 26 Jul 2015 09:28:07 -0400
    Subject: tftpDriver: don't free directory node's path string
    
    ---
     cpukit/libnetworking/lib/tftpDriver.c | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
    index 9d04025..d93ef31 100644
    a b static int rtems_tftp_eval_path( 
    512512        size_t pathlen = pathnamelen;
    513513        size_t len = currentlen + pathlen;
    514514
    515         current = realloc (current, len + 1);
     515        current = malloc (len + 1);
    516516        if (current != NULL) {
     517            memcpy (current, currentloc->node_access, currentlen);
    517518            memcpy (current + currentlen, path, pathlen);
    518519            current [len] = '\0';
    519520            if (!rtems_tftp_is_directory (current, len)) {