Fix refleak introduced in rev. 51248.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 2189a82..f3ef4b8 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -4226,8 +4226,10 @@
 		return NULL;
 
 	buf = PyString_AsString(result);
-	if (!buf)
+	if (!buf) {
+		Py_DECREF(result);
 		return NULL;
+	}
 
 	/* To modify the string in-place, there can only be one reference. */
 	if (result->ob_refcnt != 1) {