]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/status.c
Use POOLMEM and get_memory instead of alloca in src/dird/status.c and src/stored...
[bacula/bacula] / bacula / src / stored / status.c
index d9b4f05028dd98b5d229bf5fb10d34a02bcd6ac3..14f99b2639f957e286f7cd2e603d505267bad410 100644 (file)
@@ -425,17 +425,18 @@ static void sendit(const char *msg, int len, void *arg)
 int qstatus_cmd(JCR *jcr)
 {
    BSOCK *dir = jcr->dir_bsock;
-   char *time;
+   POOLMEM *time;
    JCR *njcr;
    s_last_job* job;
 
-   time = (char *) alloca(dir->msglen+1);
+   time = get_memory(dir->msglen+1);
    
    if (sscanf(dir->msg, qstatus, time) != 1) {
       pm_strcpy(&jcr->errmsg, dir->msg);
       Jmsg1(jcr, M_FATAL, 0, _("Bad .status command: %s\n"), jcr->errmsg);
       bnet_fsend(dir, "3900 Bad .status command, missing argument.\n");
       bnet_sig(dir, BNET_EOD);
+      free_memory(time);
       return 0;
    }
    unbash_spaces(time);
@@ -463,9 +464,11 @@ int qstatus_cmd(JCR *jcr)
       Jmsg1(jcr, M_FATAL, 0, _("Bad .status command: %s\n"), jcr->errmsg);
       bnet_fsend(dir, "3900 Bad .status command, wrong argument.\n");
       bnet_sig(dir, BNET_EOD);
+      free_memory(time);
       return 0;
    }
    
    bnet_sig(dir, BNET_EOD);
+   free_memory(time);
    return 1;
 }