]> granicus.if.org Git - postgresql/commitdiff
ECPG: Simplify free_variable()
authorMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:15:44 +0000 (17:15 +0100)
committerMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:42:32 +0000 (17:42 +0100)
Patch by Boszormenyi Zoltan <zb@cybertec.at>

src/interfaces/ecpg/ecpglib/execute.c

index 1a7876ecf2d7db90abda37e289f2b38d9e15f1b5..e5ee8a9b8422aa9366b4147230201c26baa43b8c 100644 (file)
@@ -87,16 +87,11 @@ free_variable(struct variable * var)
 {
        struct variable *var_next;
 
-       if (var == NULL)
-               return;
-       var_next = var->next;
-       ecpg_free(var);
-
-       while (var_next)
+       while (var)
        {
-               var = var_next;
                var_next = var->next;
                ecpg_free(var);
+               var = var_next;
        }
 }