Skip to content

Call to infolist_free is missing #2

@flashcode

Description

@flashcode

Hi,

An error is reported in the script by weechat-script-lint:

gateway_rename.scm:68: error [missing_infolist_free]: missing call to infolist_free
gateway_rename.scm:233: warning [modifier_irc_in]: modifier irc_in_privmsg should be replaced by irc_in2_privmsg which sends only valid UTF-8 data
gateway_rename.scm: score = 70 / 100
FAILED: 1 scripts analyzed, 1 with issues: 1 errors, 1 warnings, 0 info
Exiting with code 1

So for sure a call to infolist_free is missing.
When inspecting the script, I found weird that there is no loop on the infolist, it seems only the first item of the list (the first IRC server) is processed, or did I miss something?

You can check by just loading the script in WeeChat (default config, nothing else loaded):

$ weechat -t -r '/script load /path/to/gateway_rename.scm;/debug infolists'

Result:

1 infolists in memory (WARNING: this is probably a memory leak in WeeChat or plugins/scripts!)
   1: infolist 0x55642f5f7680: 0 items, 0 vars - structs: 48, data: 0 (total: 48 bytes)
Total: 0 items, 0 vars - 48 bytes

In addition a warning on irc_in_privmsg is reported, but the problem is minor and it's not always an issue, but you can check as well if irc_in2_privmsg is better.

Once fixed, is it possible to submit a new version of the script via PR at https://github.com/weechat/scripts?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions