[Freeipa-devel] C coding style guide update

Lukas Slebodnik lslebodn at redhat.com
Tue Aug 4 08:28:40 UTC 2015


On (27/07/15 15:54), Michal Židek wrote:
>On 07/26/2015 10:09 PM, Jakub Hrozek wrote:
>>     - Variable Length arrays are very helpful, but explicitly mention
>>       they should be used with caution, especially if array size might
>>       come from the user
>
>+1
>We overuse talloc for very small allocations that can be done
>automatically on stack.
>
They were already used 2.5 year ago (line 3903)

408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3893) void nss_update_initgr_memcache(struct nss_ctx *nctx,
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3894)                                 const char *name, const char *domain,
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3895)                                 int gnum, uint32_t *groups)
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3896) {
1f15b746 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-19 08:48:06 -0500 3897)     TALLOC_CTX *tmp_ctx = NULL;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3898)     struct sss_domain_info *dom;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3899)     struct ldb_result *res;
0c517cb7 src/responder/nss/nsssrv_cmd.c    (Jakub Hrozek       2013-01-15 07:05:56 +0100 3900)     struct sized_string delete_name;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3901)     bool changed = false;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3902)     uint32_t id;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3903)     uint32_t gids[gnum];
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3904)     int ret;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3905)     int i, j;
408914f6 src/responder/nss/nsssrv_cmd.c    (Simo Sorce         2012-12-05 17:40:44 +0000 3906)

LS




More information about the Freeipa-devel mailing list