Previously, when these wrappers exhausted memory they would return a null
pointer leading to follow on memory corruption and debugging confusion. It seems
simpler to just stop when we run out of memory as we have no reasonable recovery
path at this time.
- graphviz-2.42.2-coverity-scan-fixes.patch
- graphviz-2.42.2-dotty-menu-fix.patch
- graphviz-2.42.2-ocaml-allow-const-cast.patch
+- some allocation failures that could previously allow memory corruption now exit
### Fixed
- Neato's hier mode is broken since v2.44.0 #1726
#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "memory.h"
void *p = realloc(ptr, size * elt);
if (p == NULL && size) {
fprintf(stderr, "out of memory\n");
- return p;
+ exit(EXIT_FAILURE);
}
if (osize < size)
memset((char *) p + (osize * elt), '\0', (size - osize) * elt);
rv = malloc(nbytes);
if (rv == NULL) {
fprintf(stderr, "out of memory\n");
+ exit(EXIT_FAILURE);
}
return rv;
}
void *p = realloc(ptr, size);
if (p == NULL && size) {
fprintf(stderr, "out of memory\n");
+ exit(EXIT_FAILURE);
}
return p;
}