summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/edje/edje_lua2.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/edje/edje_lua2.c b/src/lib/edje/edje_lua2.c
index 28e6667fda..1ea61e5ca0 100644
--- a/src/lib/edje/edje_lua2.c
+++ b/src/lib/edje/edje_lua2.c
@@ -491,12 +491,15 @@ _elua_scan_params(lua_State *L, int i, char *params, ...) // Stack usage -
491 size_t len; 491 size_t len;
492 char *temp = (char *)lua_tolstring(L, j, &len); // Stack usage [-0, +0, m] 492 char *temp = (char *)lua_tolstring(L, j, &len); // Stack usage [-0, +0, m]
493 493
494 len++; // Cater for the null at the end. 494 if (temp)
495 *v = malloc(len);
496 if (*v)
497 { 495 {
498 memcpy(*v, temp, len); 496 len++; // Cater for the null at the end.
499 n++; 497 *v = malloc(len);
498 if (*v)
499 {
500 memcpy(*v, temp, len);
501 n++;
502 }
500 } 503 }
501 } 504 }
502 break; 505 break;