connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Cc: connman@lists.linux.dev, Jan.Ryll@bshg.com, Simon.Holesch@bshg.com
Subject: Re: [PATCH] Add GetKnownServices api to connaman
Date: Tue, 26 Oct 2021 09:37:37 +0200	[thread overview]
Message-ID: <20211026073737.jtlyqaj2azyiauee@carbon.lan> (raw)
In-Reply-To: <CAOf5uwk-7TNhtfqUY-7Pb_w1id3yq5=jyJdv0Gf9OE46Zp+DAg@mail.gmail.com>

On Tue, Oct 26, 2021 at 09:09:06AM +0200, Michael Nazzareno Trimarchi wrote:
> > > +             service->identifier = g_strdup(services[i]);
> > > +             service_id_parts = g_strsplit(services[i], "_", -1);
> > > +
> > > +             if (service_id_parts == NULL) {
> > > +                     g_free(service);
> > > +                     continue;
> > > +             }
> >
> > IIRC, this check will always be false, as g_strsplit() will return a
> > valid array or call abort() if allocation fails.
> >
> 
> I don't want an abort to be called, I will adjust it.

Sorry, I didn't express it clearly, g_strsplit() will call abort(). This
means the return value of g_str*() function always succeed, thus you
don't have to check for NULL.

  reply	other threads:[~2021-10-26  7:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 13:26 [PATCH] Add GetKnownServices api to connaman Michael Trimarchi
2021-10-26  7:04 ` Daniel Wagner
2021-10-26  7:09   ` Michael Nazzareno Trimarchi
2021-10-26  7:37     ` Daniel Wagner [this message]
2021-10-26  7:42       ` Michael Nazzareno Trimarchi

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=20211026073737.jtlyqaj2azyiauee@carbon.lan \
    --to=wagi@monom.org \
    --cc=Jan.Ryll@bshg.com \
    --cc=Simon.Holesch@bshg.com \
    --cc=connman@lists.linux.dev \
    --cc=michael@amarulasolutions.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).