correct ref counting of default_action (closes #22017)
diff --git a/Misc/NEWS b/Misc/NEWS
index d2fc3e2..efad9ea 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,9 @@
 Library
 -------
 
+- Issue #22017: Correct reference counting errror in the initialization of the
+  _warnings module.
+
 - Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
   attribute.  Based on patch by Martin Panter.
 
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 445ff6b..92d6547 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -905,6 +905,7 @@
     _default_action = PyString_FromString("default");
     if (_default_action == NULL)
         return;
+    Py_INCREF(_default_action);
     if (PyModule_AddObject(m, "default_action", _default_action) < 0)
         return;
 }