Suppress compiler warning, and not incidentally make the code more
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Jul 2008 04:20:24 +0000 (04:20 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Jul 2008 04:20:24 +0000 (04:20 +0000)
robust.  The previous coding was quite risky because it was testing
conditions different from 'is the array really allocated?'.

src/bin/psql/describe.c

index 369b6abe33c9ade700292567966a19512f1f9f96..900130d6eb5bd9b79a4768d7850a4a9b62ffe39d 100644 (file)
@@ -1591,14 +1591,14 @@ error_return:
        termPQExpBuffer(&title);
        termPQExpBuffer(&tmpbuf);
        
-       if (tableinfo.relkind == 'S')
+       if (seq_values)
        {
                for (ptr = seq_values; *ptr; ptr++)
                        free(*ptr);
                free(seq_values);
        }
     
-       if (show_modifiers)
+       if (modifiers)
        {
                for (ptr = modifiers; *ptr; ptr++)
                        free(*ptr);