VirtualBox

Changeset 94388 in vbox


Ignore:
Timestamp:
Mar 29, 2022 7:06:06 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150699
Message:

VBoxNetAdpCtl: Some harmless leak fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp

    r93479 r94388  
    457457    }
    458458    if (dry_run)
     459    {
     460        free((void *)argv);
    459461        return EXIT_SUCCESS;
     462    }
    460463
    461464    int rc = EXIT_FAILURE; /* o/~ hope for the best, expect the worst */
     
    512515    int rc = EXIT_SUCCESS;
    513516    int fds[2];
    514     char * const * argv = allocArgv(getShowCommand(pcszAdapter));
    515     char * const envp[] = { (char*)"LC_ALL=C", NULL };
    516517
    517518    memset(aszAddresses, 0, sizeof(aszAddresses));
     
    532533        rc = dup2(fds[1], STDOUT_FILENO);
    533534        if (rc >= 0)
     535        {
     536            char * const * argv = allocArgv(getShowCommand(pcszAdapter));
     537            char * const envp[] = { (char*)"LC_ALL=C", NULL };
     538
    534539            if (execve(argv[0], argv, envp) == -1)
     540            {
     541                free((void *)argv);
    535542                return errno;
     543            }
     544
     545            free((void *)argv);
     546        }
    536547        return rc;
    537548    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette