File: | duplicity/_librsyncmodule.c |
Function: | _librsync_new_deltamaker |
Error: | ob_refcnt of '*dm' is 1 too high |
177 static PyObject*
178 _librsync_new_deltamaker(PyObject* self, PyObject* args)
179 {
180 _librsync_DeltaMakerObject* dm;
181 char *sig_string, outbuf[RS_JOB_BLOCKSIZE];
182 int sig_length;
183 rs_job_t *sig_loader;
184 rs_signature_t *sig_ptr;
185 rs_buffers_t buf;
186 rs_result result;
187
188 if (!PyArg_ParseTuple(args,"s#:new_deltamaker", &sig_string, &sig_length))
when PyArg_ParseTuple() succeeds
taking False path
189 return NULL;
190
191 dm = PyObject_New(_librsync_DeltaMakerObject, &_librsync_DeltaMakerType);
when _PyObject_New() succeeds
_PyObject_New allocated at: dm = PyObject_New(_librsync_DeltaMakerObject, &_librsync_DeltaMakerType);
ob_refcnt is now refs: 1 + N where N >= 0
192 if (dm == NULL) return NULL;
taking False path
193 dm->x_attr = NULL;
194
195 /* Put signature at sig_ptr and build hash */
196 sig_loader = rs_loadsig_begin(&sig_ptr);
197 buf.next_in = sig_string;
198 buf.avail_in = (size_t)sig_length;
199 buf.next_out = outbuf;
200 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE;
201 buf.eof_in = 1;
202 result = rs_job_iter(sig_loader, &buf);
203 rs_job_free(sig_loader);
204 if (result != RS_DONE) {
when taking True path
205 _librsync_seterror(result, "delta rs_signature_t builder");
206 return NULL;
207 }
208 if ((result = rs_build_hash_table(sig_ptr)) != RS_DONE) {
209 _librsync_seterror(result, "delta rs_build_hash_table");
210 return NULL;
211 }
212
213 dm->sig_ptr = sig_ptr;
214 dm->delta_job = rs_delta_begin(sig_ptr);
215 return (PyObject*)dm;
216 }
ob_refcnt of '*dm' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 1 similar trace(s) to this
File: | duplicity/_librsyncmodule.c |
Function: | _librsync_new_deltamaker |
Error: | returning (PyObject*)NULL without setting an exception |
177 static PyObject*
178 _librsync_new_deltamaker(PyObject* self, PyObject* args)
179 {
180 _librsync_DeltaMakerObject* dm;
181 char *sig_string, outbuf[RS_JOB_BLOCKSIZE];
182 int sig_length;
183 rs_job_t *sig_loader;
184 rs_signature_t *sig_ptr;
185 rs_buffers_t buf;
186 rs_result result;
187
188 if (!PyArg_ParseTuple(args,"s#:new_deltamaker", &sig_string, &sig_length))
when PyArg_ParseTuple() succeeds
taking False path
189 return NULL;
190
191 dm = PyObject_New(_librsync_DeltaMakerObject, &_librsync_DeltaMakerType);
when _PyObject_New() succeeds
192 if (dm == NULL) return NULL;
taking False path
193 dm->x_attr = NULL;
194
195 /* Put signature at sig_ptr and build hash */
196 sig_loader = rs_loadsig_begin(&sig_ptr);
197 buf.next_in = sig_string;
198 buf.avail_in = (size_t)sig_length;
199 buf.next_out = outbuf;
200 buf.avail_out = (size_t)RS_JOB_BLOCKSIZE;
201 buf.eof_in = 1;
202 result = rs_job_iter(sig_loader, &buf);
203 rs_job_free(sig_loader);
204 if (result != RS_DONE) {
when taking True path
205 _librsync_seterror(result, "delta rs_signature_t builder");
206 return NULL;
207 }
208 if ((result = rs_build_hash_table(sig_ptr)) != RS_DONE) {
209 _librsync_seterror(result, "delta rs_build_hash_table");
210 return NULL;
211 }
212
213 dm->sig_ptr = sig_ptr;
214 dm->delta_job = rs_delta_begin(sig_ptr);
215 return (PyObject*)dm;
216 }
returning (PyObject*)NULL without setting an exception
found 1 similar trace(s) to this