load-fragment: add missing oom check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 May 2018 04:26:24 +0000 (13:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 May 2018 04:26:27 +0000 (13:26 +0900)
Fixes CID#1391379.

src/core/load-fragment.c

index 0bc162a..bb258c4 100644 (file)
@@ -811,7 +811,8 @@ int config_parse_socket_bindtodevice(
                 return 0;
         }
 
-        free_and_strdup(&s->bind_to_device, rvalue);
+        if (free_and_strdup(&s->bind_to_device, rvalue) < 0)
+                return log_oom();
 
         return 0;
 }