Skip to content

Commit

Permalink
Check for strdup(3) failure in cacheProcAddress()
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Ritger <[email protected]>
Signed-off-by: Brian Nguyen <[email protected]>
  • Loading branch information
aritger committed Sep 4, 2013
1 parent 345a2f3 commit f7e7657
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/GLX/libglx.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,13 @@ static void cacheProcAddress(const GLubyte *procName, __GLXextFuncPtr addr)
}

pEntry->procName = (GLubyte *)strdup((const char *)procName);

if (pEntry->procName == NULL) {
assert(pEntry->procName);
free(pEntry);
return;
}

pEntry->addr = addr;

LKDHASH_WRLOCK(__glXPthreadFuncs, __glXProcAddressHash);
Expand Down

0 comments on commit f7e7657

Please sign in to comment.