projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check result of memory allocations (patch by Stanislav Fomichev)
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
d23e910
..
0530eb2
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-508,7
+508,7
@@
invalid:
/*
* escape an uci string for export
*/
/*
* escape an uci string for export
*/
-static char *uci_escape(struct uci_context *ctx, const char *str)
+static c
onst c
har *uci_escape(struct uci_context *ctx, const char *str)
{
const char *end;
int ofs = 0;
{
const char *end;
int ofs = 0;
@@
-516,6
+516,9
@@
static char *uci_escape(struct uci_context *ctx, const char *str)
if (!ctx->buf) {
ctx->bufsz = LINEBUF;
ctx->buf = malloc(LINEBUF);
if (!ctx->buf) {
ctx->bufsz = LINEBUF;
ctx->buf = malloc(LINEBUF);
+
+ if (!ctx->buf)
+ return str;
}
while (1) {
}
while (1) {