Re: [PATCH v3/GSoC 2/5] path.c: implement xdg_runtime_dir()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



惠轶群 <huiyiqun@xxxxxxxxx> writes:

> After read the source code of strbuf more carefully, I get the conclusion
> that if a strbuf is initialized with STRBUF_INIT but is not used, there is
> no need to release it. Is it true?

If it is initialized with STRBUF_INIT and never used, there is no
reason for the variable to exist ;-)

Leaving the variable in the code, and not calling release on it at
the end, would be OK (i.e. there is no leak) today, but may invite
future bugs (e.g. people may use the variable to tentatively build
their string before the function returns to leave the scope of the
variable without adding _release() themselves).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]