FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Forgot to add error check? · Issue #106916 · python/cpython · GitHub

/ cpython Public

Forgot to add error check? #106916

Description

#106411 adds the _PyCompile_CleanDoc function.
there's a call to PyMem_Malloc, but we don't check if it returns NULL value:

cpython/Python/compile.c

Lines 8055 to 8063 in 009e8f0

char *buff = PyMem_Malloc(doc_size);
char *w = buff;
while (p < pend) {
int ch = *w++ = *p++;
if (ch == '\n') {
break;
}
}

Is there a need to check for a NULL value?
If so, I can send a PR.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL