diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 10:15:50 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 10:17:20 +0200 |
commit | da6e295140fc1a1ef56db1c6f792e86793f7f2b1 (patch) | |
tree | 06a44c125b858f0b498555d722d2ab8f2f85fbf5 /src | |
parent | 5ba46aeec2900c23a0c260093daf56180f1180c0 (diff) | |
download | pies-da6e295140fc1a1ef56db1c6f792e86793f7f2b1.tar.gz pies-da6e295140fc1a1ef56db1c6f792e86793f7f2b1.tar.bz2 |
Bugfix
* src/comp.c (component_config_commit): Correctly handle
empty list of components.
Diffstat (limited to 'src')
-rw-r--r-- | src/comp.c | 10 | ||||
-rw-r--r-- | src/progman.c | 1 |
2 files changed, 9 insertions, 2 deletions
@@ -466,9 +466,15 @@ component_config_commit (void) | |||
466 | 466 | ||
467 | /* Count available components and allocate array for them */ | 467 | /* Count available components and allocate array for them */ |
468 | for (comp = list->head, i = 0; comp; comp = comp->next, i++) | 468 | for (comp = list->head, i = 0; comp; comp = comp->next, i++) |
469 | /* FIXME: component_compute_prereq (comp) */; | 469 | /* nothing */; |
470 | 470 | ||
471 | comp_array = grecs_realloc (comp_array, i * sizeof (comp_array[0])); | 471 | if (i == 0) |
472 | { | ||
473 | free (comp_array); | ||
474 | comp_array = NULL; | ||
475 | } | ||
476 | else | ||
477 | comp_array = grecs_realloc (comp_array, i * sizeof (comp_array[0])); | ||
472 | comp_count = i; | 478 | comp_count = i; |
473 | 479 | ||
474 | /* Rearrange components, registering prog entries for the new ones */ | 480 | /* Rearrange components, registering prog entries for the new ones */ |
diff --git a/src/progman.c b/src/progman.c index 52c875f..a6202f3 100644 --- a/src/progman.c +++ b/src/progman.c | |||
@@ -174,6 +174,7 @@ destroy_prog (struct prog **pp) | |||
174 | component_ref_decr (p->v.p.comp); | 174 | component_ref_decr (p->v.p.comp); |
175 | if (p->v.p.status == status_listener && p->v.p.socket != -1) | 175 | if (p->v.p.status == status_listener && p->v.p.socket != -1) |
176 | deregister_socket (p->v.p.socket); | 176 | deregister_socket (p->v.p.socket); |
177 | /* FIXME: Remove also all dependent progs (esp. tcpmux) */ | ||
177 | break; | 178 | break; |
178 | 179 | ||
179 | case TYPE_REDIRECTOR: | 180 | case TYPE_REDIRECTOR: |