sql: Remove redundant enumerator allocation
authorTobias Brunner <tobias@strongswan.org>
Fri, 26 May 2017 13:10:04 +0000 (15:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 26 May 2017 14:39:33 +0000 (16:39 +0200)
Interestingly, this doesn't show up in the regression tests because the
compiler removes the first assignment (and thus the allocation) due to
-O2 that's included in our default CFLAGS.

src/libcharon/plugins/sql/sql_config.c

index 55e8181..00ed693 100644 (file)
@@ -598,7 +598,7 @@ METHOD(enumerator_t, peer_enumerator_destroy, void,
 METHOD(backend_t, create_peer_cfg_enumerator, enumerator_t*,
        private_sql_config_t *this, identification_t *me, identification_t *other)
 {
-       peer_enumerator_t *e = malloc_thing(peer_enumerator_t);
+       peer_enumerator_t *e;
 
        INIT(e,
                .public = {