aboutsummaryrefslogtreecommitdiff
path: root/captain
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-06-21 13:27:10 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-06-21 13:27:10 -0400
commit660235928d1dd57d85cb7bd986c5036783a6073f (patch)
treeebbd98f90690acaa0cf5bdbf4dc4f82f10ea455f /captain
parent20091904b7bf4b2074b45e25c7eee0e56d19348b (diff)
downloadlevitating-660235928d1dd57d85cb7bd986c5036783a6073f.tar.gz
levitating-660235928d1dd57d85cb7bd986c5036783a6073f.zip
Fixed memory issue caused by multiple deallocation calls.
Diffstat (limited to 'captain')
-rw-r--r--captain/queryutils.f9021
-rw-r--r--captain/web.f908
2 files changed, 13 insertions, 16 deletions
diff --git a/captain/queryutils.f90 b/captain/queryutils.f90
index 4f3d805..550a2f3 100644
--- a/captain/queryutils.f90
+++ b/captain/queryutils.f90
@@ -56,18 +56,18 @@ implicit none
contains
subroutine query_component_parse(self, comptext)
- use logging
implicit none
class(query_component), intent(out)::self
character(*), intent(in)::comptext
character(len=:), pointer::decoded
- integer::i_in, i_out, i_equals, chnum
-
- allocate(character(len=len_trim(comptext)) :: decoded)
- decoded = " "
-
+ integer::i_in, i_out, i_equals, chnum, n
+
+ n = len_trim(comptext)
+ allocate(character(len=n) :: decoded)
+ decoded = repeat(" ", n)
+
i_equals = 0
i_out = 1
i_in = 1
@@ -100,8 +100,6 @@ contains
self%value = decoded(i_equals+1:len_trim(decoded))
end if
- deallocate(decoded)
-
end subroutine query_component_parse
elemental subroutine query_component_destroy(self)
@@ -130,14 +128,17 @@ contains
end function query_component_has_key
subroutine query_init(self, str)
+ use logging
implicit none
class(query), intent(out)::self
character(len=*), intent(in)::str
+ character(64)::msg
- integer::ampersands, i, i_end, i_comp
+ integer::ampersands, i, i_end, i_comp, n
- allocate(character(len=len_trim(str)) :: self%full)
+ n = len_trim(str)
+ allocate(character(len=n) :: self%full)
self%full = str
ampersands = 0
diff --git a/captain/web.f90 b/captain/web.f90
index 9254658..dac658b 100644
--- a/captain/web.f90
+++ b/captain/web.f90
@@ -393,9 +393,7 @@ contains
j = get_player_id(trim(player_name))
call add_entry_to_group_db(id, i, j)
-
- deallocate(qreq)
-
+
else
qreq => q%get_value("delete")
@@ -410,9 +408,7 @@ contains
j = get_player_id(trim(player_name))
call remove_entry_from_group_db(id, i, j)
-
- deallocate(qreq)
-
+
else if(trim(req%query_string) == "launch") then
call launch_group(id)