diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2025-10-22 16:22:52 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2025-10-22 16:22:52 -0400 |
| commit | 716c451128a141acbae1ccab6946c716021a977f (patch) | |
| tree | 87e2a9039cbe5ca6854404f69c668c91805c67ce /src/pl/plpython/plpy_elog.c | |
| parent | bc310c6ff3463c65ce532a437f1d27a4318c8b4a (diff) | |
Remove useless pstrdup() calls.
The result of PLyUnicode_AsString is already palloc'd,
so pstrdup'ing it is just a waste of time and memory.
More importantly it might confuse people about whether
that's necessary. Doesn't seem important enough to
back-patch, but we should fix it. Spotted by Coverity.
Diffstat (limited to 'src/pl/plpython/plpy_elog.c')
| -rw-r--r-- | src/pl/plpython/plpy_elog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c index f6d10045e5c..a7c664f1ca1 100644 --- a/src/pl/plpython/plpy_elog.c +++ b/src/pl/plpython/plpy_elog.c @@ -571,7 +571,7 @@ get_string_attr(PyObject *obj, char *attrname, char **str) val = PyObject_GetAttrString(obj, attrname); if (val != NULL && val != Py_None) { - *str = pstrdup(PLyUnicode_AsString(val)); + *str = PLyUnicode_AsString(val); } Py_XDECREF(val); } |
