Staging
v0.5.1
https://github.com/python/cpython
Revision 4b250fc1da9c893803cf724a4974450b5e10bd8a authored by Guido van Rossum on 11 February 2019, 16:10:42 UTC, committed by GitHub on 11 February 2019, 16:10:42 UTC
If PyUnicode_DecodeUTF8() returns NULL, PyArena_AddPyObject() would crash.
Found by @msullivan for https://github.com/python/typed_ast/pull/93.
1 parent 537b6ca
Raw File
Tip revision: 4b250fc1da9c893803cf724a4974450b5e10bd8a authored by Guido van Rossum on 11 February 2019, 16:10:42 UTC
bpo-35766 follow-up: Add an error check to new_type_comment() (#11766)
Tip revision: 4b250fc
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
    if (str != NULL) {
        char *copy = malloc(strlen(str) + 1);
        if (copy != NULL)
            return strcpy(copy, str);
    }
    return NULL;
}
back to top