Prevent core dump from calling Tcl_DontCallWhenDeleted() with a null
authorTom Lane <[email protected]>
Sat, 1 Feb 2003 00:22:23 +0000 (00:22 +0000)
committerTom Lane <[email protected]>
Sat, 1 Feb 2003 00:22:23 +0000 (00:22 +0000)
interp pointer.  Per report from Gerhard Hintermayer.

src/interfaces/libpgtcl/pgtclId.c

index bf9ed5fa46fe2f9a2cedda99550195bcb0adac4c..b9766812fc0f9e08238df739db85b8e2c6266b02 100644 (file)
@@ -273,8 +273,9 @@ PgDelConnectionId(DRIVER_DEL_PROTO)
                Tcl_DeleteHashTable(&notifies->notify_hash);
                if (notifies->conn_loss_cmd)
                        ckfree((void *) notifies->conn_loss_cmd);
-               Tcl_DontCallWhenDeleted(notifies->interp, PgNotifyInterpDelete,
-                                                               (ClientData) notifies);
+               if (notifies->interp)
+                       Tcl_DontCallWhenDeleted(notifies->interp, PgNotifyInterpDelete,
+                                                                       (ClientData) notifies);
                ckfree((void *) notifies);
        }