]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/child.c
Use safe wrappers wherever possible
[i3/i3] / i3bar / src / child.c
index 78354685051625bd3b79042d316a8fb545e0fab2..cfc96d5f1ad2d4841f39ceb39480e235fb93cb26 100644 (file)
@@ -220,21 +220,21 @@ static int stdin_string(void *context, const unsigned char *val, size_t len) {
         return 1;
     }
     if (strcasecmp(ctx->last_map_key, "min_width") == 0) {
-        char *copy = (char *)malloc(len + 1);
+        char *copy = (char *)smalloc(len + 1);
         strncpy(copy, (const char *)val, len);
         copy[len] = 0;
         ctx->block.min_width_str = copy;
         return 1;
     }
     if (strcasecmp(ctx->last_map_key, "name") == 0) {
-        char *copy = (char *)malloc(len + 1);
+        char *copy = (char *)smalloc(len + 1);
         strncpy(copy, (const char *)val, len);
         copy[len] = 0;
         ctx->block.name = copy;
         return 1;
     }
     if (strcasecmp(ctx->last_map_key, "instance") == 0) {
-        char *copy = (char *)malloc(len + 1);
+        char *copy = (char *)smalloc(len + 1);
         strncpy(copy, (const char *)val, len);
         copy[len] = 0;
         ctx->block.instance = copy;