Skip to content

Commit

Permalink
gensio: Remove dead code from str_to_gensio_accepter()
Browse files Browse the repository at this point in the history
Move the args variable to the scope where it belongs and remove the
bogus free.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Feb 2, 2024
1 parent 26cfee7 commit 0e65909
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/gensio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,6 @@ str_to_gensio_accepter(const char *str,
struct gensio_accepter **accepter)
{
int err = GE_INVAL;
const char **args = NULL;
struct registered_gensio_accepter *r;
size_t len;
bool retried = false;
Expand All @@ -1591,6 +1590,8 @@ str_to_gensio_accepter(const char *str,
str++;
retry:
for (r = reg_gensio_accs; r; r = r->next) {
const char **args = NULL;

len = strlen(r->name);
if (strncmp(r->name, str, len) != 0 ||
(str[len] != ',' && str[len] != '(' && str[len]))
Expand All @@ -1612,9 +1613,6 @@ str_to_gensio_accepter(const char *str,
goto retry;
}

if (args)
gensio_argv_free(o, args);

return err;
}

Expand Down

0 comments on commit 0e65909

Please sign in to comment.