Ticket #43008: patch-lib-runcmd.c.diff

File patch-lib-runcmd.c.diff, 554 bytes (added by jul_bsd@…, 10 years ago)
  • lib/runcmd.c

    old new  
    587587        /* For Solaris and systems that don't have setenv().
    588588         * This will leak memory, but in a "controlled" way, since the memory
    589589         * should be freed when the child process exits. */
    590         if (asprintf(&env_string, "%s=%s", name, value) = -1) return -1;
     590        if (asprintf(&env_string, "%s=%s", name, value) == -1) return -1;
    591591        if (!env_string) {
    592                 errno == ENOMEM;
     592                errno = ENOMEM;
    593593                return -1;
    594594        }
    595595        return putenv(env_string);