Coverity #985: Avoid segfault on malloc failure.
This commit is contained in:
parent
536628bb4b
commit
bda292120f
|
@ -1,3 +1,8 @@
|
||||||
|
2006-04-06 Adam Jackson <ajax@freedesktop.org>
|
||||||
|
|
||||||
|
* GL/glx/single2.c:
|
||||||
|
Coverity #985: Avoid segfault on malloc failure.
|
||||||
|
|
||||||
2006-04-06 Adam Jackson <ajax@freedesktop.org>
|
2006-04-06 Adam Jackson <ajax@freedesktop.org>
|
||||||
|
|
||||||
* hw/dmx/dmxextension.c:
|
* hw/dmx/dmxextension.c:
|
||||||
|
|
|
@ -270,12 +270,12 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string)
|
||||||
if (clen > slen) {
|
if (clen > slen) {
|
||||||
combo_string = (char *) xalloc(slen + 2);
|
combo_string = (char *) xalloc(slen + 2);
|
||||||
s1 = (char *) xalloc(slen + 2);
|
s1 = (char *) xalloc(slen + 2);
|
||||||
strcpy(s1, sext_string);
|
if (s1) strcpy(s1, sext_string);
|
||||||
s2 = cext_string;
|
s2 = cext_string;
|
||||||
} else {
|
} else {
|
||||||
combo_string = (char *) xalloc(clen + 2);
|
combo_string = (char *) xalloc(clen + 2);
|
||||||
s1 = (char *) xalloc(clen + 2);
|
s1 = (char *) xalloc(clen + 2);
|
||||||
strcpy(s1, cext_string);
|
if (s1) strcpy(s1, cext_string);
|
||||||
s2 = sext_string;
|
s2 = sext_string;
|
||||||
}
|
}
|
||||||
if (!combo_string || !s1) {
|
if (!combo_string || !s1) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user