All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Jordi Pujol <jordipujolp@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Jason Wang <jasowang@redhat.com>,
	Laurent Vivier <laurent@vivier.eu>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v4] smb daemon get additional command line parameters from env variable
Date: Sat, 2 Nov 2019 09:33:00 +0100	[thread overview]
Message-ID: <20191102083300.hm36idtj753ftbx4@function> (raw)
In-Reply-To: <CACTE=grkUZErGiW4=USWPS=Q4kpo1C8QupucnnS8ry3Z00DumQ@mail.gmail.com>

Jordi Pujol, le sam. 02 nov. 2019 08:41:52 +0100, a ecrit:
> @@ -909,6 +910,12 @@ static int slirp_smb(SlirpState* s, cons
>               CONFIG_SMBD_COMMAND, s->smb_dir, smb_conf);
>      g_free(smb_conf);
> 
> +    options = g_getenv("SMBDOPTIONS");
> +    if (options) {
> +        smb_cmdline = g_strdup_printf("%s %s", smb_cmdline, options);
> +        g_free(options);
> +    }

Again, what g_getenv mustn't be freed. I believe you even get a warning
about it: g_getenv returns a const gchar *.

The old value of smb_cmdline, however, has to be freed, otherwise that's
a memory leak.

Samuel


      reply	other threads:[~2019-11-02  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACTE=gpFbUSxXeTwu6_tzSeoh_9Yp905aMdzCPCUz3h7kcgeyw@mail.gmail.com>
2019-10-31 12:47 ` smb daemon get additional command line parameters from env variable Laurent Vivier
2019-10-31 13:33   ` [PATCH v2] " Jordi Pujol
2019-10-31 16:15     ` Samuel Thibault
2019-11-01 14:38       ` [PATCH v3] " Jordi Pujol
2019-11-01 14:54         ` Samuel Thibault
2019-11-02  7:41           ` [PATCH v4] " Jordi Pujol
2019-11-02  8:33             ` Samuel Thibault [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191102083300.hm36idtj753ftbx4@function \
    --to=samuel.thibault@gnu.org \
    --cc=jan.kiszka@siemens.com \
    --cc=jasowang@redhat.com \
    --cc=jordipujolp@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.